Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit b4502f3

Browse files
authored
Merge pull request #5 from magento-south/MAGETWO-58071
[GITHUB] preg_match(): Compilation failed on Hebrew locale #2966
2 parents c9d607b + 3b013c1 commit b4502f3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

library/Zend/Locale/Format.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ private static function _getRegexForType($type, $options)
570570
case '#':
571571
case '-#':
572572
if ($part[0] == '-') {
573-
$regex[$pkey] .= '[' . $symbols['minus'] . '-]{0,1}';
573+
$regex[$pkey] .= '[' . preg_quote($symbols['minus']) . '-]{0,1}';
574574
} else {
575575
$regex[$pkey] .= '[' . $symbols['plus'] . '+]{0,1}';
576576
}
@@ -614,7 +614,7 @@ private static function _getRegexForType($type, $options)
614614
if (($pattern == '#E0') || ($pattern == '#E00')) {
615615
$regex[$pkey] .= '[' . $symbols['plus']. '+]{0,1}[0-9]{1,}(\\' . $symbols['decimal'] . '[0-9]{1,})*[eE][' . $symbols['plus']. '+]{0,1}[0-9]{1,}';
616616
} else if (($pattern == '-#E0') || ($pattern == '-#E00')) {
617-
$regex[$pkey] .= '[' . $symbols['minus']. '-]{0,1}[0-9]{1,}(\\' . $symbols['decimal'] . '[0-9]{1,})*[eE][' . $symbols['minus']. '-]{0,1}[0-9]{1,}';
617+
$regex[$pkey] .= '[' . preg_quote($symbols['minus']) . '-]{0,1}[0-9]{1,}(\\' . $symbols['decimal'] . '[0-9]{1,})*[eE][' . preg_quote($symbols['minus']) . '-]{0,1}[0-9]{1,}';
618618
} else {
619619
throw new Zend_Locale_Exception('Unsupported token for numberformat (Pos 5):"' . $pattern . '"');
620620
}
@@ -624,7 +624,7 @@ private static function _getRegexForType($type, $options)
624624
if ($end == '###') {
625625
$regex[$pkey] .= '(\\' . $symbols['decimal'] . '{1}[0-9]{1,}){0,1}';
626626
} else if ($end == '###-') {
627-
$regex[$pkey] .= '(\\' . $symbols['decimal'] . '{1}[0-9]{1,}){0,1}[' . $symbols['minus']. '-]';
627+
$regex[$pkey] .= '(\\' . $symbols['decimal'] . '{1}[0-9]{1,}){0,1}[' . preg_quote($symbols['minus']) . '-]';
628628
} else {
629629
throw new Zend_Locale_Exception('Unsupported token for numberformat (Pos 6):"' . $pattern . '"');
630630
}

0 commit comments

Comments
 (0)