Skip to content

Commit

Permalink
fix: added missing conversion to HTML entities
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Mar 9, 2023
1 parent 7c7699d commit 0dc8e52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions phpmyfaq/admin/category.edit.php
Expand Up @@ -19,6 +19,7 @@
use phpMyFAQ\Category\CategoryPermission;
use phpMyFAQ\Filter;
use phpMyFAQ\Helper\UserHelper;
use phpMyFAQ\Strings;

if (!defined('IS_VALID_PHPMYFAQ')) {
http_response_code(400);
Expand Down Expand Up @@ -58,7 +59,8 @@
$restrictedGroups = true;
}

$header = $PMF_LANG['ad_categ_edit_1'] . ' "' . $categoryData->getName() . '" ' . $PMF_LANG['ad_categ_edit_2'];
$header = $PMF_LANG['ad_categ_edit_1'] . ' "' . Strings::htmlentities($categoryData->getName()) .
'" ' . $PMF_LANG['ad_categ_edit_2'];
?>
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">
Expand All @@ -81,7 +83,7 @@
<?= $PMF_LANG['ad_categ_titel'] ?>:
</label>
<div class="col-lg-4">
<input type="text" id="name" name="name" value="<?= $categoryData->getName() ?>"
<input type="text" id="name" name="name" value="<?= Strings::htmlentities($categoryData->getName()) ?>"
class="form-control">
</div>
</div>
Expand All @@ -92,7 +94,7 @@ class="form-control">
</label>
<div class="col-lg-4">
<textarea id="description" name="description" rows="3"
class="form-control"><?= $categoryData->getDescription() ?></textarea>
class="form-control"><?= Strings::htmlentities($categoryData->getDescription()) ?></textarea>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions phpmyfaq/admin/category.main.php
Expand Up @@ -155,8 +155,8 @@

$parentId = Filter::filterInput(INPUT_POST, 'parent_id', FILTER_VALIDATE_INT);
$categoryId = Filter::filterInput(INPUT_POST, 'id', FILTER_VALIDATE_INT);
$categoryLang = Filter::filterInput(INPUT_POST, 'catlang', FILTER_UNSAFE_RAW);
$existingImage = Filter::filterInput(INPUT_POST, 'existing_image', FILTER_UNSAFE_RAW);
$categoryLang = Filter::filterInput(INPUT_POST, 'catlang', FILTER_SANITIZE_SPECIAL_CHARS);
$existingImage = Filter::filterInput(INPUT_POST, 'existing_image', FILTER_SANITIZE_SPECIAL_CHARS);
$image = count($uploadedFile) ? $categoryImage->getFileName(
$categoryId,
$categoryLang
Expand Down

0 comments on commit 0dc8e52

Please sign in to comment.