Skip to content
Snippets Groups Projects
Commit f3e40468 authored by Thomas Lake's avatar Thomas Lake :wrench:
Browse files

Fix the – replacement regex

parent 4f6ebd6b
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ function decode_entities($text, $quote_style = ENT_COMPAT) { ...@@ -10,7 +10,7 @@ function decode_entities($text, $quote_style = ENT_COMPAT) {
$trans_tbl = array_flip($trans_tbl); $trans_tbl = array_flip($trans_tbl);
$text = strtr($text, $trans_tbl); $text = strtr($text, $trans_tbl);
} }
$text = preg_replace('~&ndash\;~ei', '-', $text); $text = preg_replace('~&ndash\;~i', '-', $text);
$text = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $text); $text = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $text);
$text = preg_replace('~&#([0-9]+);~e', 'chr("\\1")', $text); $text = preg_replace('~&#([0-9]+);~e', 'chr("\\1")', $text);
return $text; return $text;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment