Skip to content
Snippets Groups Projects
Commit 620b8f44 authored by Denis Walker's avatar Denis Walker
Browse files

Fixes problem with regex for ndash

parent e2152132
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('–', '-', $text); $text = preg_replace('~–~ei', '-', $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