Skip to content

Commit

Permalink
Merge pull request #5 from magento-south/MAGETWO-58071
Browse files Browse the repository at this point in the history
[GITHUB] preg_match(): Compilation failed on Hebrew locale #2966
  • Loading branch information
slavvka authored Sep 14, 2016
2 parents c9d607b + 3b013c1 commit b4502f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/Zend/Locale/Format.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ private static function _getRegexForType($type, $options)
case '#':
case '-#':
if ($part[0] == '-') {
$regex[$pkey] .= '[' . $symbols['minus'] . '-]{0,1}';
$regex[$pkey] .= '[' . preg_quote($symbols['minus']) . '-]{0,1}';
} else {
$regex[$pkey] .= '[' . $symbols['plus'] . '+]{0,1}';
}
Expand Down Expand Up @@ -614,7 +614,7 @@ private static function _getRegexForType($type, $options)
if (($pattern == '#E0') || ($pattern == '#E00')) {
$regex[$pkey] .= '[' . $symbols['plus']. '+]{0,1}[0-9]{1,}(\\' . $symbols['decimal'] . '[0-9]{1,})*[eE][' . $symbols['plus']. '+]{0,1}[0-9]{1,}';
} else if (($pattern == '-#E0') || ($pattern == '-#E00')) {
$regex[$pkey] .= '[' . $symbols['minus']. '-]{0,1}[0-9]{1,}(\\' . $symbols['decimal'] . '[0-9]{1,})*[eE][' . $symbols['minus']. '-]{0,1}[0-9]{1,}';
$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,}';
} else {
throw new Zend_Locale_Exception('Unsupported token for numberformat (Pos 5):"' . $pattern . '"');
}
Expand All @@ -624,7 +624,7 @@ private static function _getRegexForType($type, $options)
if ($end == '###') {
$regex[$pkey] .= '(\\' . $symbols['decimal'] . '{1}[0-9]{1,}){0,1}';
} else if ($end == '###-') {
$regex[$pkey] .= '(\\' . $symbols['decimal'] . '{1}[0-9]{1,}){0,1}[' . $symbols['minus']. '-]';
$regex[$pkey] .= '(\\' . $symbols['decimal'] . '{1}[0-9]{1,}){0,1}[' . preg_quote($symbols['minus']) . '-]';
} else {
throw new Zend_Locale_Exception('Unsupported token for numberformat (Pos 6):"' . $pattern . '"');
}
Expand Down

0 comments on commit b4502f3

Please sign in to comment.