Skip to content

Commit

Permalink
fix: added missing quoting for search terms
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Oct 21, 2022
1 parent 372428d commit c7904f2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion phpmyfaq/index.php
Expand Up @@ -549,7 +549,7 @@
'dir' => $PMF_LANG['dir'],
'writeSendAdress' => '?' . $sids . 'action=search',
'searchBox' => $PMF_LANG['msgSearch'],
'searchTerm' => Strings::htmlspecialchars($searchTerm),
'searchTerm' => Strings::htmlspecialchars($searchTerm, ENT_QUOTES),
'categoryId' => ($cat === 0) ? '%' : (int)$cat,
'headerCategories' => $PMF_LANG['msgFullCategories'],
'msgCategory' => $PMF_LANG['msgCategory'],
Expand Down
2 changes: 1 addition & 1 deletion phpmyfaq/search.php
Expand Up @@ -286,7 +286,7 @@
'searchBoxSection',
[
'writeSendAdress' => '?' . $sids . 'action=search',
'searchString' => Strings::htmlspecialchars($inputSearchTerm, ENT_QUOTES, 'utf-8'),
'searchString' => Strings::htmlspecialchars($inputSearchTerm, ENT_QUOTES),
'searchOnAllLanguages' => $PMF_LANG['msgSearchOnAllLanguages'],
'checkedAllLanguages' => $allLanguages ? ' checked' : '',
'selectCategories' => $PMF_LANG['msgSelectCategories'],
Expand Down
6 changes: 3 additions & 3 deletions phpmyfaq/src/phpMyFAQ/Strings.php
Expand Up @@ -305,9 +305,9 @@ public static function htmlspecialchars(
*/
public static function htmlentities(
string $string,
$quoteStyle = ENT_HTML5,
$charset = 'utf-8',
$doubleEncode = true
int $quoteStyle = ENT_HTML5,
string $charset = 'utf-8',
bool $doubleEncode = false
): string
{
return htmlentities(
Expand Down

0 comments on commit c7904f2

Please sign in to comment.