From 557571b23b39e4f087cbddaa7afd5417ae11422a Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Wed, 4 Oct 2017 22:27:31 +0200 Subject: force using utf-8 as charset for htmlentities/htmlspecialchars (#12135) --- tests/PHPUnit/System/AutoSuggestAPITest.php | 2 +- tests/PHPUnit/System/LabelFilterTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/PHPUnit') diff --git a/tests/PHPUnit/System/AutoSuggestAPITest.php b/tests/PHPUnit/System/AutoSuggestAPITest.php index 8a3900cf8d..414dfccd5f 100644 --- a/tests/PHPUnit/System/AutoSuggestAPITest.php +++ b/tests/PHPUnit/System/AutoSuggestAPITest.php @@ -104,7 +104,7 @@ class AutoSuggestAPITest extends SystemTestCase $topSegmentValue = Common::forceDotAsSeparatorForDecimalPoint($topSegmentValue); } // Now build the segment request - $segmentValue = rawurlencode(html_entity_decode($topSegmentValue)); + $segmentValue = rawurlencode(html_entity_decode($topSegmentValue, ENT_COMPAT | ENT_HTML401, 'UTF-8')); $params['segment'] = $params['segmentToComplete'] . '==' . $segmentValue; unset($params['segmentToComplete']); $this->runApiTests($api, $params); diff --git a/tests/PHPUnit/System/LabelFilterTest.php b/tests/PHPUnit/System/LabelFilterTest.php index 809409754b..f19828638d 100644 --- a/tests/PHPUnit/System/LabelFilterTest.php +++ b/tests/PHPUnit/System/LabelFilterTest.php @@ -113,7 +113,7 @@ class LabelFilterTest extends SystemTestCase ); $return[] = array('Referrers.getSearchEngines', $searchEngineTest); - $searchEngineTest['otherRequestParameters']['label'] = urlencode('Google>' . urlencode(html_entity_decode($keyword))); + $searchEngineTest['otherRequestParameters']['label'] = urlencode('Google>' . urlencode(html_entity_decode($keyword, ENT_COMPAT | ENT_HTML401, 'UTF-8'))); $return[] = array('Referrers.getSearchEngines', $searchEngineTest); // test the ! operator -- cgit v1.2.3