New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
preg_match() unkown modifier '?' in valid.php . #351
Comments
@mas1375 php 7.3? add dump localeconv() rework:
|
@WinterSilence PHP 7.2. |
@mas1375 show dump |
@mas1375 @WinterSilence cannot reproduce this one. Is it a error / issue of the framework? |
it's localeconv() dump : array (size=18)
'decimal_point' => string '/' (length=1)
'thousands_sep' => string ',' (length=1)
'int_curr_symbol' => string 'IRR' (length=3)
'currency_symbol' => string 'ريال' (length=8)
'mon_decimal_point' => string '/' (length=1)
'mon_thousands_sep' => string ',' (length=1)
'positive_sign' => string '' (length=0)
'negative_sign' => string '-' (length=1)
'int_frac_digits' => int 2
'frac_digits' => int 2
'p_cs_precedes' => int 0
'p_sep_by_space' => int 0
'n_cs_precedes' => int 0
'n_sep_by_space' => int 0
'p_sign_posn' => int 3
'n_sign_posn' => int 3
'grouping' =>
array (size=1)
0 => int 3
'mon_grouping' =>
array (size=1)
0 => int 3 and the $str value is : '26' |
@toitzi as i already say, problem in |
@WinterSilence Thanks for clarification! |
@WinterSilence Does your code above fix it? Can you make a PR out of it? |
@toitzi i cant: new github plugin for atom ide use direct pull (i think its bug), i cant use old plugin - ide not support it |
there is another solution for it, according to the manual :
so : return (bool) preg_match('/^-?+(?=.*[0-9])[09]*+' . preg_quote($decimal, '/') . '?+[0-9]*+$/D', (string) $str); |
- fixed an issue with preg_quote() . - Closes koseven#351
/**
* Checks whether a string is a valid number (negative and decimal numbers allowed).
*
* Uses {@link http://www.php.net/manual/en/function.localeconv.php locale conversion}
* to allow decimal point to be locale specific.
*
* @param string $str input string
* @return boolean
*/
public static function numeric($str)
{
// Get the decimal point for the current locale
list($decimal) = array_values(localeconv());
// my solution : return (bool) true ; :)
** but what is that error for??? **
The text was updated successfully, but these errors were encountered: