Skip to content

Commit

Permalink
Support for PHP 8.0 and 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mhcwebdesign committed Mar 4, 2022
1 parent 0d0f2ce commit 2b2b758
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
12 changes: 12 additions & 0 deletions upload/catalog/controller/startup/startup.php
@@ -1,5 +1,17 @@
<?php
class ControllerStartupStartup extends Controller {

public function __isset($key) {
// To make sure that calls to isset also support dynamic properties from the registry
// See https://www.php.net/manual/en/language.oop5.overloading.php#object.isset
if ($this->registry) {
if ($this->registry->get($key)!==null) {
return true;
}
}
return false;
}

public function index() {
// Store
if ($this->request->server['HTTPS']) {
Expand Down
2 changes: 1 addition & 1 deletion upload/catalog/model/catalog/product.php
Expand Up @@ -42,7 +42,7 @@ public function getProduct($product_id) {
'height' => $query->row['height'],
'length_class_id' => $query->row['length_class_id'],
'subtract' => $query->row['subtract'],
'rating' => round($query->row['rating']),
'rating' => round(($query->row['rating']===null) ? 0 : $query->row['rating']),
'reviews' => $query->row['reviews'] ? $query->row['reviews'] : 0,
'minimum' => $query->row['minimum'],
'sort_order' => $query->row['sort_order'],
Expand Down
2 changes: 1 addition & 1 deletion upload/system/library/db/mysqli.php
Expand Up @@ -50,7 +50,7 @@ public function query($sql) {
}

public function escape($value) {
return $this->connection->real_escape_string($value);
return $this->connection->real_escape_string(($value===null) ? '' : $value);
}

public function countAffected() {
Expand Down
2 changes: 1 addition & 1 deletion upload/system/library/session/db.php
Expand Up @@ -18,7 +18,7 @@ public function read($session_id) {
if ($query->num_rows) {
return json_decode($query->row['data'], true);
} else {
return false;
return array();
}
}

Expand Down

4 comments on commit 2b2b758

@matrixboy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job
Thank you

@AlfMueller
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job
Thank you!!!!

@abdulnasir25
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job.
Thank you!

@gor2em
Copy link

@gor2em gor2em commented on 2b2b758 Jan 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks.

Please sign in to comment.