New Zenner
- Join Date:
- Jan 2010
- Posts:
- 55
- Plugin Contributions:
- 0
Version Server tripping PHP notices
Zen Cart 1.5.7c
PHP 7.4.16
Template ZCA Bootstrap 3.1.1 clone
When I check for new version from admin, I'm encountering the following PHP notices:
[27-Apr-2021 08:36:26 America/Los_Angeles] Request URI: /admin/?vcheck=yes, IP address: 98.246.177.0
#1 VersionServer->isProjectCurrent() called at [/home2/.../public_html/.../admin/includes/header.php:102]
#2 require(/home2/.../public_html/.../admin/includes/header.php) called at [/home2/.../public_html/.../admin/index_dashboard.php:32]
#3 require(/home2/.../public_html/.../admin/index_dashboard.php) called at [/home2/.../public_html/.../admin/home.php:25]
#4 require(/home2/.../public_html/.../admin/home.php) called at [/home2/.../public_html/.../admin/index.php:11]
--> PHP Notice: Trying to access array offset on value of type null in /home2/.../public_html/.../admin/includes/classes/VersionServer.php on line 86.
[27-Apr-2021 08:36:26 America/Los_Angeles] Request URI: /admin/?vcheck=yes, IP address: 98.246.177.0
#1 VersionServer->isProjectCurrent() called at [/home2/.../public_html/.../admin/includes/header.php:102]
#2 require(/home2/.../public_html/.../admin/includes/header.php) called at [/home2/.../public_html/.../admin/index_dashboard.php:32]
#3 require(/home2/.../public_html/.../admin/index_dashboard.php) called at [/home2/.../public_html/.../admin/home.php:25]
#4 require(/home2/.../public_html/.../admin/home.php) called at [/home2/.../public_html/.../admin/index.php:11]
--> PHP Notice: Trying to access array offset on value of type null in /home2/.../public_html/.../admin/includes/classes/VersionServer.php on line 89.
Digging into the VersionServer class revealed that the getProjectVersion() method is returning the json_decode() of:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Error</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Raleway:100,600" rel="stylesheet" type="text/css">
<!-- Styles -->
<style>
html, body {
background-color: #fff;
color: #636b6f;
font-family: 'Raleway', sans-serif;
font-weight: 100;
height: 100vh;
margin: 0;
}
.full-height {
height: 100vh;
}
.flex-center {
align-items: center;
display: flex;
justify-content: center;
}
.position-ref {
position: relative;
}
.content {
text-align: center;
}
.title {
font-size: 36px;
padding: 20px;
}
</style>
<script async src='/cdn-cgi/bm/cv/669835187/api.js'></script></head>
<body>
<div class="flex-center position-ref full-height">
<div class="content">
<div class="title">
Whoops, looks like something went wrong. </div>
</div>
</div>
<script type="text/javascript">(function(){window['__CF$cv$params']={r:'6461aa832a33928c',m:'fa95aacd7ac18b7380e4fcae829ee7b6634194ee-1619459559-1800-ARbfKzTjnVy04kUPeVof1wtV75b+tHKB2deUE7Fv1jfQvpnaqSrUaPTQ9q6T8DcEmvCM029wy/en5FNT6KczynjFZzrF0UL5qdcC0PWgxGVjEH9TsX0m3/SBLNhXMLQsIg==',s:[0xef8d3f77ac,0xcfbc9d2a8d],}})();</script></body>
</html>
Obviously this is HTML, not the expected JSON.
I believe that this has been happening for several weeks now. I noticed previously that a version 1.5.5f cart using Square 0.97 was reporting that a newer version of that payment module was available. A few weeks ago, the notice disappeared. I did not investigate at that time. After the disappearance of this notice, I also noticed that Zen Cart version 1.5.5f was being reported as being current while it had previously reported that version 1.5.7c was available.
Since then I've updated the cart to 1.5.7c. I've disabled the version check on the admin home page via Configuration -> My Store -> Show if version update available to avoid creating myDEBUG log files whenever the admin home page is accessed.
I get the same PHP notices when running carts on XAMPP.