1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-11 09:04:38 +02:00

Related to Issue #3741 - Incorrect encoding of a plugin language file could cause json encoding to fail.

This commit is contained in:
Cameron
2020-03-24 13:57:05 -07:00
parent 6c242729b9
commit 852ab5a32f
4 changed files with 64 additions and 10 deletions

View File

@@ -108,16 +108,15 @@ $data = array (
$this->assertArrayHasKey('TITLE', $actual);
// case sitePrefs
// $string_6 = $this->getSitePrefExample();
// $actual = $this->arrObj->unserialize($string_6);
$tests = array(
0 => array('string' => $this->getSitePrefExample(),
0 => array(
'string' => $this->getSitePrefExample(),
'expected' => array('email_password' => '$2y$10$IpizFx.gp5USl98SLXwwbeod3SYF3M3raAQX0y01ETexzoutvdyWW' )
),
1 => array(
'string' => "{\n \"hello\": \"h\u00e9ll\u00f2 w\u00f2rld\"\n}",
'expected' => array('hello'=>'héllò wòrld')
),
);
@@ -167,5 +166,13 @@ $data = array (
$expected5 = "{\n \"hello\": \"world\"\n}";
$this->assertEquals($expected5,$result5);
$pref6 = array('hello'=> mb_convert_encoding('héllò wòrld', 'ISO-8859-1'));
$result6 = $this->arrObj->serialize($pref6,'json');
$expected6 = "{\n \"hello\": \"h\u00e9ll\u00f2 w\u00f2rld\"\n}";
$this->assertEquals($expected6,$result6);
}
}