Skip to content

Commit c7904f2

Browse files
committed
fix: added missing quoting for search terms
1 parent 372428d commit c7904f2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

phpmyfaq/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@
549549
'dir' => $PMF_LANG['dir'],
550550
'writeSendAdress' => '?' . $sids . 'action=search',
551551
'searchBox' => $PMF_LANG['msgSearch'],
552-
'searchTerm' => Strings::htmlspecialchars($searchTerm),
552+
'searchTerm' => Strings::htmlspecialchars($searchTerm, ENT_QUOTES),
553553
'categoryId' => ($cat === 0) ? '%' : (int)$cat,
554554
'headerCategories' => $PMF_LANG['msgFullCategories'],
555555
'msgCategory' => $PMF_LANG['msgCategory'],

phpmyfaq/search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@
286286
'searchBoxSection',
287287
[
288288
'writeSendAdress' => '?' . $sids . 'action=search',
289-
'searchString' => Strings::htmlspecialchars($inputSearchTerm, ENT_QUOTES, 'utf-8'),
289+
'searchString' => Strings::htmlspecialchars($inputSearchTerm, ENT_QUOTES),
290290
'searchOnAllLanguages' => $PMF_LANG['msgSearchOnAllLanguages'],
291291
'checkedAllLanguages' => $allLanguages ? ' checked' : '',
292292
'selectCategories' => $PMF_LANG['msgSelectCategories'],

phpmyfaq/src/phpMyFAQ/Strings.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ public static function htmlspecialchars(
305305
*/
306306
public static function htmlentities(
307307
string $string,
308-
$quoteStyle = ENT_HTML5,
309-
$charset = 'utf-8',
310-
$doubleEncode = true
308+
int $quoteStyle = ENT_HTML5,
309+
string $charset = 'utf-8',
310+
bool $doubleEncode = false
311311
): string
312312
{
313313
return htmlentities(

0 commit comments

Comments
 (0)