Zen Cart Logo
Forums / Bug Reports / Missing file in ZC 1.5.5e ??

Missing file in ZC 1.5.5e ??

Locked

Views: 31,753

Results 1 to 20 of 23
This thread is locked. New replies are disabled.
2 Mar 2017, 11:20 PM
#1
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Missing file in ZC 1.5.5e ??

Did a comparison of file changes btw 1.5.5d and 1.5.5e and can't find the file

/admin/includes/classes/upload.php

in the 1.5.5e file system.

Am I missing something?

3 Mar 2017, 12:23 AM
#2
barco57 avatar

barco57

Totally Zenned

Join Date:
Apr 2006
Location:
West Salem, IL
Posts:
2,845
Plugin Contributions:
0

Re: Missing file in ZC 1.5.5e ??

I believe this is relevant from the announcement

Consolidate to a single upload class, shared between admin/catalog

the change log should probably list that the file was dropped from the admin/includes/classes

3 Mar 2017, 1:01 AM
#3
frank18 avatar

frank18

Deceased

Join Date:
Nov 2007
Location:
Sunny Coast, Australia
Posts:
3,427
Plugin Contributions:
2

Re: Missing file in ZC 1.5.5e ??

barco57:

.....the change log should probably list that the file was dropped from the admin/includes/classes

That's what I thought, should be a heading "Deleted files in ZC 1.5.5e" and that file listed there.

3 Mar 2017, 2:28 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Missing file in ZC 1.5.5e ??

Turns out it should have also mentioned that another file was changed too:

/admin/includes/functions/database.php

This was changed in v155d but not everybody got it, so best to update it too. :)

3 Mar 2017, 11:53 AM
#6
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: Missing file in ZC 1.5.5e ??

Having now caught up with this and found out about the 'missing' file as detailed above. If do the upgrade to 'e' from 'd' then my admin logon fails. However, when looking at the debug log I see that:

/includes/classes/upload.php

is 'failing'. If I revert this file to the 'd' version, leaving all the other changes at their 'e' versions, then everything works.

The live site works perfectly ether way of course. Any ideas ?

Michael

3 Mar 2017, 12:23 PM
#7
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: Missing file in ZC 1.5.5e ??

This is the acual debug error message. I am afraid I am not really up-to-speed with php, so not sure what is wrong ?:

[03-Mar-2017 04:49:24 America/Phoenix] PHP Parse error: syntax error, unexpected '[' in /home/content/78/11924578/html/includes/classes/upload.php on line 25

and this is line 25:

function __construct($file = '', $destination = '', $permissions = '644', $extensions = [])

Michael

3 Mar 2017, 2:16 PM
#8
wonged avatar

wonged

New Zenner

Join Date:
Feb 2011
Posts:
33
Plugin Contributions:
0

Re: Missing file in ZC 1.5.5e ??

DrByte:

Turns out it should have also mentioned that another file was changed too:

/admin/includes/functions/database.php

DrByte, so if I am following your two replies, I am supposed to ...

  1. delete from my site /admin/includes/classes/upload.php ?
  2. upload a new version of /admin/includes/functions/database.php from the 1.5.5e zip file ?
3 Mar 2017, 4:13 PM
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Missing file in ZC 1.5.5e ??

Mikeondraco:

Having now caught up with this and found out about the 'missing' file as detailed above. If do the upgrade to 'e' from 'd' then my admin logon fails. However, when looking at the debug log I see that:

/includes/classes/upload.php

is 'failing'. If I revert this file to the 'd' version, leaving all the other changes at their 'e' versions, then everything works.

The live site works perfectly ether way of course. Any ideas ?

Michael

Mikeondraco:

This is the acual debug error message. I am afraid I am not really up-to-speed with php, so not sure what is wrong ?:

[03-Mar-2017 04:49:24 America/Phoenix] PHP Parse error: syntax error, unexpected '[' in /home/content/78/11924578/html/includes/classes/upload.php on line 25

and this is line 25:

function __construct($file = '', $destination = '', $permissions = '644', $extensions = [])

Michael

What version of PHP are you using? I assume it's 5.3.x or less based on the response and the expectation of PHP version in which the provided code works...

3 Mar 2017, 4:26 PM
#10
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: Missing file in ZC 1.5.5e ??

Just cheked with my hosting company (GoDaddy) and it reports PHP 5.3

Michael

3 Mar 2017, 4:37 PM
#11
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: Missing file in ZC 1.5.5e ??

Mikeondraco:

Just cheked with my hosting company (GoDaddy) and it reports PHP 5.3

Michael

OK, have initiated an upgrade to PHP 5.4 which will take a little while to precolate through. Should this resolve my issue?

TA ... Michael

3 Mar 2017, 4:58 PM
#12
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Missing file in ZC 1.5.5e ??

Mikeondraco:

OK, have initiated an upgrade to PHP 5.4 which will take a little while to precolate through. Should this resolve my issue?

TA ... Michael

It should.

Unfortunately the new version of the upload file by using the square brackets as an empty array modifies the functional PHP versions for ZC 1.5.5 beginning in this revision to be PHP 5.4+. If instead of:

= []

this were used:

= array()

then it wouldn't have caused an error, but also wouldn't be as up-to-date with current language construct. The same type of assignment is used elsewhere within the class file, so if someone wanted to modify the file (downgrade it), changes should also be made to other locations besides line 25.

3 Mar 2017, 6:13 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Missing file in ZC 1.5.5e ??

A new zip has been published and contains a downgraded upload.php class to accommodate the older PHP versions, as well as fixes to the changed-files list:
https://www.zen-cart.com/showthread.php?219730-Zen-Cart-v1-5-5e-released!&p=1326914#post1326914

But, really, you should be upgrading to a modern version of PHP !!!!!! As of January 2017 even PHP 5.6 is no longer officially being developed (security patches only). The modern version of PHP is 7.1 ... see http://php.net/supported-versions.php

3 Mar 2017, 6:17 PM
#14
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Missing file in ZC 1.5.5e ??

wonged:

DrByte, so if I am following your two replies, I am supposed to ...

  1. delete from my site /admin/includes/classes/upload.php ?
  2. upload a new version of /admin/includes/functions/database.php from the 1.5.5e zip file ?
    Yes .
3 Mar 2017, 7:53 PM
#15
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: Missing file in ZC 1.5.5e ??

DrByte:

A new zip has been published and contains a downgraded upload.php class to accommodate the older PHP versions, as well as fixes to the changed-files list:
https://www.zen-cart.com/showthread.php?219730-Zen-Cart-v1-5-5e-released!&p=1326914#post1326914

But, really, you should be upgrading to a modern version of PHP !!!!!! As of January 2017 even PHP 5.6 is no longer officially being developed (security patches only). The modern version of PHP is 7.1 ... see http://php.net/supported-versions.php

Apprciate what you are saying, but I can only upgrade to whatever my hosting company offers

Michael

3 Mar 2017, 7:53 PM
#16
mikeondraco avatar

mikeondraco

Zen Follower

Join Date:
Feb 2015
Location:
UK
Posts:
165
Plugin Contributions:
0

Re: Missing file in ZC 1.5.5e ??

Thank you

Michael

6 Mar 2017, 8:39 PM
#17
reetp avatar

reetp

New Zenner

Join Date:
Nov 2008
Posts:
46
Plugin Contributions:
0

Re: Missing file in ZC 1.5.5e ??

I've just had this failure where I can get to the main site but not to my admin page.

Downloaded version https://sourceforge.net/projects/zencart/files/v1.5.5e/v1.5.5e.tar.gz dated 03/03/2017

The log shows the following error:

[06-Mar-2017 21:06:39] PHP Parse error: syntax error, unexpected '[' in html/zencart-155e/includes/classes/upload.php on line 205
[06-Mar-2017 21:06:39] PHP Stack trace:
[06-Mar-2017 21:06:39] PHP 1. {main}() html/zencart-155e/myadmin/index.php:0
[06-Mar-2017 21:06:39] PHP 2. require() html/zencart-155e/myadmin/index.php:10
[06-Mar-2017 21:06:39] PHP 3. require() html/zencart-155e/myadmin/includes/application_top.php:171

The issue was in this section

function set_extensions($extensions)

Here's the diff for the fix I tried that seemed to work. HOWEVER, I am not sure what else may or may not break as yet.

--- upload.orig 2017-03-06 21:23:01.000000000 +0100
+++ upload.php 2017-03-06 21:24:07.713163300 +0100
@@ -202,10 +202,10 @@
if (is_array($extensions)) {
$this->extensions = $extensions;
} else {

  •            $this->extensions = [$extensions];
    
  •            $this->extensions = ($extensions);
           }
       } else {
    
  •        $this->extensions = [];
    
  •        $this->extensions = array();
       }
    
    }

Yes, I run CentOS 6 with PHP 5.3.x It is supported by RHEL until end of life in 2020.

Yes I could possibly mess about with SCL repos to upgrade PHP but I personally hate doing anything outside of standard - less chance of breakage that way. There are probably many who may not be ALLOWED to mess with their servers due to service contracts etc etc, or are bound by what their hosting provides. So my guess is that PHP 5.3.x will be around for a few more years yet, like it or not.

I would certainly call this a bug and it should be fixed - a php check would do it I guess.

I just hope their are no more gotchas... I am no coder and wasted a good deal of time on this.

B. Rgds
John

6 Mar 2017, 9:42 PM
#18
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Missing file in ZC 1.5.5e ??

See my post above for the fix you can apply to work with your old PHP version.

6 Mar 2017, 9:50 PM
#19
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Missing file in ZC 1.5.5e ??

DrByte:

See my post above for the fix you can apply to work with your old PHP version.

Unfortunately, unless at least github has been updated in the last 10 minutes or so, there are two areas that did not get reverted back to the "old" way beginning around line 199:

    function set_extensions($extensions)
    {
        if (zen_not_null($extensions)) {
            if (is_array($extensions)) {
                $this->extensions = $extensions;
            } else {
                $this->extensions = [$extensions];
            }
        } else {
            $this->extensions = [];
        }
    }

To:

    function set_extensions($extensions)
    {
        if (zen_not_null($extensions)) {
            if (is_array($extensions)) {
                $this->extensions = $extensions;
            } else {
                $this->extensions = array($extensions);
            }
        } else {
            $this->extensions = array();
        }
    }