Advertisement:

Author Topic: PHP Notice & Warning : A non well formed numeric value  (Read 341 times)

Aficionado

  • Guest
PHP Notice & Warning : A non well formed numeric value
« on: September 26, 2018, 08:51:29 am »
PHP Notice:  A non well formed numeric value encountered in /home/oc-includes/osclass/ItemActions.php on line 1285

PHP Warning:  A non-numeric value encountered in /home/oc-includes/osclass/ItemActions.php on line 1285


PHP 7.1.x

Not sure if it comes from the core or a plugin ?
« Last Edit: September 26, 2018, 08:53:15 am by Aficionado »

WEBmods

  • Hero Member
  • *****
  • Posts: 937
  • github.com/webmods-croatia/love-osclass/ | patrick
Re: PHP Notice & Warning : A non well formed numeric value
« Reply #1 on: September 26, 2018, 03:59:01 pm »
Hello,

Seems like an error in core, when formatting the price:

Code: [Select]
<?php
            
if( !is_null($aItem['price']) ) {
                
$price str_replace(osc_locale_thousands_sep(), ''trim($aItem['price']));
                
$price str_replace(osc_locale_dec_point(), '.'$price);
                
$aItem['price'] = $price*1000000;
                
//$aItem['price'] = (float) $aItem['price'];

            
}
?>


Is it possible that a non-numeric value was inserted in price field?

Regards.

Aficionado

  • Guest
Re: PHP Notice & Warning : A non well formed numeric value
« Reply #2 on: September 26, 2018, 04:11:55 pm »
Hello, I have no idea. Just saw a few in the debug.log of one site.