Skip to content

Commit 75e9b3e

Browse files
committed
Admin: filter HTML when updating language
1 parent c263933 commit 75e9b3e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

main/admin/languages.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,15 @@
195195

196196
if (isset($_POST['Submit']) && $_POST['Submit']) {
197197
// changing the name
198-
$name = Database::escape_string($_POST['txt_name']);
198+
$name = html_filter($_POST['txt_name']);
199199
$postId = (int) $_POST['edit_id'];
200-
$sql = "UPDATE $tbl_admin_languages SET original_name='$name'
201-
WHERE id='$postId'";
202-
$result = Database::query($sql);
200+
Database::update(
201+
$tbl_admin_languages,
202+
['original_name' => $name],
203+
['id = ?' => $postId]
204+
);
203205
// changing the Platform language
204-
if ($_POST['platformlanguage'] && $_POST['platformlanguage'] != '') {
206+
if (isset($_POST['platformlanguage']) && $_POST['platformlanguage'] != '') {
205207
api_set_setting('platformLanguage', $_POST['platformlanguage'], null, null, $_configuration['access_url']);
206208
}
207209
} elseif (isset($_POST['action'])) {

0 commit comments

Comments
 (0)