Skip to content

Commit 960bbd5

Browse files
committed
php5 fixes
1 parent 4f16acf commit 960bbd5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Utils.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class Utils
1414
{
15-
const ENCODINGS = [
15+
private static $encodings = [
1616
'ASCII' => 'ascii',
1717
'UTF-8' => 'utf-8',
1818
'SJIS' => 'shift_jis',
@@ -296,13 +296,13 @@ public static function parse($html)
296296
*/
297297
private static function normalize($string)
298298
{
299-
$detected = mb_detect_encoding($string, implode(',', array_keys(self::ENCODINGS)), true);
299+
$detected = mb_detect_encoding($string, implode(',', array_keys(self::$encodings)), true);
300300

301-
if ($detected && isset(self::ENCODINGS[$detected])) {
301+
if ($detected && isset(self::$encodings[$detected])) {
302302
$string = mb_convert_encoding($string, 'HTML-ENTITIES', $detected);
303303
$string = preg_replace(
304304
'/<head[^>]*>/',
305-
'<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset='.self::ENCODINGS[$detected].'">',
305+
'<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset='.self::$encodings[$detected].'">',
306306
$string
307307
);
308308
}

0 commit comments

Comments
 (0)