S
S
sunnysunny2019-02-19 17:35:41
opencart
sunnysunny, 2019-02-19 17:35:41

A non well formed numeric value encountered in installing the module in opencart. How to fix?

After installing the iproduct video module in Opencart, the module is barely alive, swears in the admin panel:
Notice: A non well formed numeric value encountered in /admin/model/extension/module/iproductvideo.php on line 229
The line itself: $val *= 1024;
Whole block:

private function return_bytes($val) { //from http://php.net/manual/en/function.ini-get.php
//        $val = trim($val);
        $last = strtolower($val[strlen($val)-1]);
        switch($last) {
            // The 'G' modifier is available since PHP 5.1.0
        case 'g':
            $val *= 1024;
        case 'm':
            $val *= 1024;
        case 'k':
            $val *= 1024;
        }

        return $val;
    }

After saving the settings:
A non well formed numeric value encountered in admin/model/extension/module/iproductvideo.php on line 229
Warning: Cannot modify header information - headers already sent by (output started at admin/controller/startup/error.php:34) in /system/library/response.php on line 12

How to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zoozag, 2019-02-19
@zoozag

New E_WARNING and E_NOTICE level errors have been added when using incorrect strings with operators expecting a number (+ - * / ** % << >> | & ^) and their assignment equivalents. An E_NOTICE level error is thrown when the string starts with digits but then contains non-numeric characters, and an E_WARNING level error is thrown when the string contains no digits at all.

To fix, you need to remove the last character from $val, which, according to the code g, m or k;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question