summaryrefslogtreecommitdiff
path: root/includes/unicode.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/unicode.inc')
-rw-r--r--includes/unicode.inc4
1 files changed, 4 insertions, 0 deletions
diff --git a/includes/unicode.inc b/includes/unicode.inc
index 3508aad64..0c562a8c1 100644
--- a/includes/unicode.inc
+++ b/includes/unicode.inc
@@ -303,6 +303,10 @@ function _decode_entities($prefix, $codepoint, $original, &$table, &$exclude) {
if ($prefix == '#x') {
$codepoint = base_convert($codepoint, 16, 10);
}
+ // Decimal numerical entity (strip leading zeros to avoid PHP octal notation)
+ else {
+ $codepoint = preg_replace('/^0+/', '', $codepoint);
+ }
// Encode codepoint as UTF-8 bytes
if ($codepoint < 0x80) {
$str = chr($codepoint);