@@ -570,7 +570,7 @@ private static function _getRegexForType($type, $options)
570
570
case '# ' :
571
571
case '-# ' :
572
572
if ($ part [0 ] == '- ' ) {
573
- $ regex [$ pkey ] .= '[ ' . $ symbols ['minus ' ] . '-]{0,1} ' ;
573
+ $ regex [$ pkey ] .= '[ ' . preg_quote ( $ symbols ['minus ' ]) . '-]{0,1} ' ;
574
574
} else {
575
575
$ regex [$ pkey ] .= '[ ' . $ symbols ['plus ' ] . '+]{0,1} ' ;
576
576
}
@@ -614,7 +614,7 @@ private static function _getRegexForType($type, $options)
614
614
if (($ pattern == '#E0 ' ) || ($ pattern == '#E00 ' )) {
615
615
$ regex [$ pkey ] .= '[ ' . $ symbols ['plus ' ]. '+]{0,1}[0-9]{1,}( \\' . $ symbols ['decimal ' ] . '[0-9]{1,})*[eE][ ' . $ symbols ['plus ' ]. '+]{0,1}[0-9]{1,} ' ;
616
616
} 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,} ' ;
618
618
} else {
619
619
throw new Zend_Locale_Exception ('Unsupported token for numberformat (Pos 5):" ' . $ pattern . '" ' );
620
620
}
@@ -624,7 +624,7 @@ private static function _getRegexForType($type, $options)
624
624
if ($ end == '### ' ) {
625
625
$ regex [$ pkey ] .= '( \\' . $ symbols ['decimal ' ] . '{1}[0-9]{1,}){0,1} ' ;
626
626
} 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 ' ]) . '-] ' ;
628
628
} else {
629
629
throw new Zend_Locale_Exception ('Unsupported token for numberformat (Pos 6):" ' . $ pattern . '" ' );
630
630
}
0 commit comments