Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Help Please a Fresh install i got Warning A non-numeric value encountered  (Read 4948 times)

Offline gcleff

  • Newbie
  • *
  • Posts: 12
  • Karma: +2/-0
    • View Profile
Hi im installing v1.2.9 at lincense ok at compatibility all ok at configuration ok at data load i get this error

Following error has occurred during installation:
OK: {"ret_code":50}
Name
Info
2::warning
A non-numeric value encountered in /storage/h3/704/571704/public_html/core/lib/request.php on line 148
2::warning
A non-numeric value encountered in /storage/h3/704/571704/public_html/core/lib/request.php on line 148
2::warning
A non-numeric value encountered in /storage/h3/704/571704/public_html/core/lib/request.php on line 148\

Can you help me with this thanks a lot.

below is the line 148 of request.php
   private function _detectBrowser(){

      $nua = strToLower($_SERVER['HTTP_USER_AGENT']);

      $agent['http'] = isset($nua) ? $nua : "";
      $agent['version'] = 'unknown';
      $agent['browser'] = 'unknown';
      $agent['platform'] = 'unknown';
      $agent['device_type'] = '';

      $oss = array ('win', 'mac', 'linux', 'unix');
      foreach ($oss as $os){
         if (strstr($agent['http'], $os)){
            $agent['platform'] = $os;
            break;
         }
      }

      $browsers = array ("mozilla", "msie", "gecko", "firefox", "konqueror", "safari", "netscape", "navigator", "opera", "mosaic", "lynx", "amaya", "omniweb");

      for ($i = 0; $i < count($browsers); $i++){
         if (strlen(stristr($nua, $browsers[$i])) > 0){
            $agent["browser"] = $browsers[$i];
            $n = stristr($nua, $agent["browser"]);
            $j = strpos($nua, $agent["browser"]) + $n + strlen($agent["browser"]) + 1; <--Line 148
         }
      }
« Last Edit: January 19, 2017, 04:00:45 AM by gcleff »

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2048
  • Karma: +319/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
what browser do you use?

Try to replace

Code: [Select]
$agent["browser"] = $browsers[$i];
with this

Code: [Select]
$agent["browser"] = (string)$browsers[$i];and let us know
« Last Edit: January 19, 2017, 06:34:26 AM by abolabo »
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline gcleff

  • Newbie
  • *
  • Posts: 12
  • Karma: +2/-0
    • View Profile
Hi Thank you for the help i both used IE and Firefox.

I made the change you gave me the error still persist.

      for ($i = 0; $i < count($browsers); $i++){
         if (strlen(stristr($nua, $browsers[$i])) > 0){
            $agent["browser"] = (string)$browsers[$i]; <--Change
            $n = stristr($nua, $agent["browser"]);
            $j = strpos($nua, $agent["browser"]) + $n + strlen($agent["browser"]) + 1; <--- Line 148

Following error has occurred during installation:
OK: {"ret_code":50}
Name    Info
2::warning
   A non-numeric value encountered in /storage/h3/704/571704/public_html/core/lib/request.php on line 148
2::warning
   A non-numeric value encountered in /storage/h3/704/571704/public_html/core/lib/request.php on line 148
2::warning
   A non-numeric value encountered in /storage/h3/704/571704/public_html/core/lib/request.php on line 148

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2048
  • Karma: +319/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
oh... actually you can comment line 148.
i guess you have some security software that hides browser's request headers.
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline gcleff

  • Newbie
  • *
  • Posts: 12
  • Karma: +2/-0
    • View Profile
i solved it by copying the script from old version of abantecart thanks for the help

 

Database Error

Please try again. If you come back to this error screen, report the error to an administrator.