Post by IP_CAM » Tue Apr 26, 2022 9:09 pm

A technical Question:
I found this Notice in my Openshop 1.5.6.5_rc based TWEAKS Extension, most likely related to PHP v.7.4.x:
Notice: Uninitialized string offset: 0 in admin/controller/tool/tweaks.php on line 175

Code: Select all

 foreach ($tfiles as &$tfile) {
              $tfile = str_replace('../','',$tfile);
-----          if ($tfile[0] == '/') $tfile = substr($tfile,1);     -----  Line 175
               }
              if (!$tfiles) $tfiles = array();
                 $tfiles = array_unique($tfiles);
                 sort($tfiles);
                 $info['files'] = $tfiles;
               }
Possibly someone is willing to help me with this, I would be happy, to get this fixed!
Ernie
Last edited by IP_CAM on Wed Apr 27, 2022 10:05 pm, edited 2 times in total.

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by cyclops12 » Tue Apr 26, 2022 9:36 pm

Maybe you could get some help from this ernie ??
https://www.php.net/manual/en/migration ... atible.php

Or maybe on the Changed Functions page this might be your problem

Attachments

ernie-problem.png

ernie-problem.png (416.01 KiB) Viewed 933 times


Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by JNeuhoff » Tue Apr 26, 2022 10:25 pm

Try

Code: Select all

if (substr($tfile,0,1) == '/') $tfile = substr($tfile,1);

Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig


User avatar
Guru Member

Posts

Joined
Wed Dec 05, 2007 3:38 am


Post by OSWorX » Tue Apr 26, 2022 10:28 pm

Or instead:

Code: Select all

if ($tfile[0] == '/') $tfile = substr($tfile,1);

Code: Select all

if (isset($tfile[0]) && $tfile[0] == '/') {
  $tfile = substr($tfile,1);
}

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Administrator

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by IP_CAM » Tue Apr 26, 2022 11:15 pm

Code: Select all

if (substr($tfile,0,1) == '/') $tfile = substr($tfile,1);
Well, this one seems to have worked out well.
Thanks a lot! ;)

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland
Who is online

Users browsing this forum: No registered users and 92 guests