Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter Tom

    (@petrfalk007)

    Finaly found the solution:

    simple as that – php floatval function is dangerous with specific locales

    Solution:

    add these lines into geotag.php

    // help with floatval php function problem with locale
    
    function floatval_safe($value)
    {
        $value = floatval($value);
        $larr = localeconv();
        $search = array(
            $larr['decimal_point'],
            $larr['mon_decimal_point'],
            $larr['thousands_sep'],
            $larr['mon_thousands_sep'],
            //$larr['currency_symbol'],
            //$larr['int_curr_symbol']
        );
        //$replace = array('.', '.', '', '', '', '');
        $replace = array('.', '.', '', '');
    
        return str_replace($search, $replace, $value);
    }

    and replace all occurences of floatval with new function floatval_safe

Viewing 1 replies (of 1 total)