Skip to content

Commit

Permalink
Merge pull request #24 from AJenbo/patch-1
Browse files Browse the repository at this point in the history
Fix deprecation warnings
  • Loading branch information
condor2 authored Dec 21, 2023
2 parents 392af1d + b380c35 commit add5d1e
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.4', '8.0', '8.1', '8.2']
php: ['7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
1 change: 0 additions & 1 deletion upload/admin/controller/extension/payment/pp_express.php
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,6 @@ public function recurringCancel() {
'SIGNATURE' => $api_signature,
'VERSION' => '109.0',
'BUTTONSOURCE' => 'OpenCart_2.0_EC',
'METHOD' => 'SetExpressCheckout',
'METHOD' => 'ManageRecurringPaymentsProfileStatus',
'PROFILEID' => $recurring_info['reference'],
'ACTION' => 'Cancel'
Expand Down
2 changes: 1 addition & 1 deletion upload/admin/model/extension/payment/sagepay_direct.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function sendCurl($url, $payment_data) {

$response_info = explode(chr(10), $response);

foreach ($response_info as $string) {
foreach ($response_info as $i => $string) {
if (strpos($string, '=') && isset($i)) {
$parts = explode('=', $string, 2);
$data['RepeatResponseData_' . $i][trim($parts[0])] = trim($parts[1]);
Expand Down
4 changes: 2 additions & 2 deletions upload/admin/model/extension/payment/sagepay_server.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public function sendCurl($url, $payment_data) {

$response_info = explode(chr(10), $response);

foreach ($response_info as $string) {
foreach ($response_info as $i => $string) {
if (strpos($string, '=') && isset($i)) {
$parts = explode('=', $string, 2);
$data['RepeatResponseData_' . $i][trim($parts[0])] = trim($parts[1]);
Expand All @@ -263,4 +263,4 @@ public function logger($title, $data) {
$log->write($title . ': ' . print_r($data, 1));
}
}
}
}
14 changes: 7 additions & 7 deletions upload/admin/model/sale/recurring.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,27 +163,27 @@ public function getTotalRecurrings($data) {
$implode = array();

if (!empty($data['filter_order_recurring_id'])) {
$implode[] .= "or.order_recurring_id = " . (int)$data['filter_order_recurring_id'];
$implode[] = "or.order_recurring_id = " . (int)$data['filter_order_recurring_id'];
}

if (!empty($data['filter_order_id'])) {
$implode[] .= "or.order_id = " . (int)$data['filter_order_id'];
$implode[] = "or.order_id = " . (int)$data['filter_order_id'];
}

if (!empty($data['filter_payment_reference'])) {
$implode[] .= " or.reference LIKE '" . $this->db->escape($data['filter_reference']) . "%'";
$implode[] = " or.reference LIKE '" . $this->db->escape($data['filter_reference']) . "%'";
}

if (!empty($data['filter_customer'])) {
$implode[] .= "CONCAT(o.firstname, ' ', o.lastname) LIKE '" . $this->db->escape($data['filter_customer']) . "%'";
$implode[] = "CONCAT(o.firstname, ' ', o.lastname) LIKE '" . $this->db->escape($data['filter_customer']) . "%'";
}

if (!empty($data['filter_status'])) {
$implode[] .= "or.status = " . (int)$data['filter_status'];
$implode[] = "or.status = " . (int)$data['filter_status'];
}

if (!empty($data['filter_date_added'])) {
$implode[] .= "DATE(or.date_added) = DATE('" . $this->db->escape($data['filter_date_added']) . "')";
$implode[] = "DATE(or.date_added) = DATE('" . $this->db->escape($data['filter_date_added']) . "')";
}

if ($implode) {
Expand All @@ -194,4 +194,4 @@ public function getTotalRecurrings($data) {

return (int)$query->row['total'];
}
}
}
3 changes: 1 addition & 2 deletions upload/catalog/controller/extension/recurring/pp_express.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public function cancel() {
'SIGNATURE' => $api_signature,
'VERSION' => '109.0',
'BUTTONSOURCE' => 'OpenCart_2.0_EC',
'METHOD' => 'SetExpressCheckout',
'METHOD' => 'ManageRecurringPaymentsProfileStatus',
'PROFILEID' => $recurring_info['reference'],
'ACTION' => 'Cancel'
Expand Down Expand Up @@ -108,4 +107,4 @@ public function cancel() {
$this->response->addHeader('Content-Type: application/json');
$this->response->setOutput(json_encode($json));
}
}
}
2 changes: 1 addition & 1 deletion upload/install/model/3rd_party/maxmind.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
class Model3rdPartyMaxmind extends Model {
public function editSetting($data) {
$this->db->query("REPLACE INTO `" . DB_PREFIX . "setting` SET `maxmind_key` = '" . $db->escape($data['maxmind_key']) . "', `maxmind_score` = '" . (int)$data['maxmind_score'] . "', `maxmind_order_status_id` = '" . (int)$data['maxmind_order_status_id'] . "' WHERE `store_id` = '0' AND `code` = 'maxmind'");
$this->db->query("REPLACE INTO `" . DB_PREFIX . "setting` SET `maxmind_key` = '" . $this->db->escape($data['maxmind_key']) . "', `maxmind_score` = '" . (int)$data['maxmind_score'] . "', `maxmind_order_status_id` = '" . (int)$data['maxmind_order_status_id'] . "' WHERE `store_id` = '0' AND `code` = 'maxmind'");

$this->db->query("INSERT INTO `oc_extension` (`type`, `code`) VALUES ('fraud', 'maxmind')");
}
Expand Down
5 changes: 0 additions & 5 deletions upload/system/config/paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -593,10 +593,6 @@
'code' => 'bancontact',
'name' => 'text_bancontact'
),
'bancontact' => array(
'code' => 'bancontact',
'name' => 'text_bancontact'
),
'blik' => array(
'code' => 'blik',
'name' => 'text_blik'
Expand Down Expand Up @@ -1017,4 +1013,3 @@
),
)
);
?>
12 changes: 0 additions & 12 deletions upload/system/helper/utf8.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ function utf8_strtolower($string) {
0x040C => 0x045C,
0x041F => 0x043F,
0x042C => 0x044C,
0x00DE => 0x00FE,
0x00D0 => 0x00F0,
0x1EF2 => 0x1EF3,
0x0048 => 0x0068,
0x00CB => 0x00EB,
Expand Down Expand Up @@ -248,7 +246,6 @@ function utf8_strtolower($string) {
0x0106 => 0x0107,
0x03AB => 0x03CB,
0x0426 => 0x0446,
0x00DE => 0x00FE,
0x00C7 => 0x00E7,
0x03AA => 0x03CA,
0x0421 => 0x0441,
Expand All @@ -262,13 +259,10 @@ function utf8_strtolower($string) {
0x040B => 0x045B,
0x0406 => 0x0456,
0x0102 => 0x0103,
0x039B => 0x03BB,
0x00D1 => 0x00F1,
0x041D => 0x043D,
0x038C => 0x03CC,
0x00C9 => 0x00E9,
0x00D0 => 0x00F0,
0x0407 => 0x0457,
0x0122 => 0x0123
);
}
Expand Down Expand Up @@ -424,8 +418,6 @@ function utf8_strtoupper($string) {
0x045C => 0x040C,
0x043F => 0x041F,
0x044C => 0x042C,
0x00FE => 0x00DE,
0x00F0 => 0x00D0,
0x1EF3 => 0x1EF2,
0x0068 => 0x0048,
0x00EB => 0x00CB,
Expand Down Expand Up @@ -484,7 +476,6 @@ function utf8_strtoupper($string) {
0x0107 => 0x0106,
0x03CB => 0x03AB,
0x0446 => 0x0426,
0x00FE => 0x00DE,
0x00E7 => 0x00C7,
0x03CA => 0x03AA,
0x0441 => 0x0421,
Expand All @@ -498,13 +489,10 @@ function utf8_strtoupper($string) {
0x045B => 0x040B,
0x0456 => 0x0406,
0x0103 => 0x0102,
0x03BB => 0x039B,
0x00F1 => 0x00D1,
0x043D => 0x041D,
0x03CC => 0x038C,
0x00E9 => 0x00C9,
0x00F0 => 0x00D0,
0x0457 => 0x0407,
0x0123 => 0x0122
);
}
Expand Down
3 changes: 2 additions & 1 deletion upload/system/library/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
class Session {
public $session_id = '';
public $data = array();
public $adaptor;

public function __construct($adaptor = 'native') {
$class = 'Session\\' . $adaptor;
Expand Down Expand Up @@ -74,4 +75,4 @@ public function destroy($key = 'default') {

setcookie($key, '', time() - 42000, ini_get('session.cookie_path'), ini_get('session.cookie_domain'));
}
}
}
13 changes: 5 additions & 8 deletions upload/system/library/session/file.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
<?php
namespace Session;
class File extends \SessionHandler {
public function create_sid() {
return parent::create_sid();
}

#[\ReturnTypeWillChange]
public function open($path, $name) {
return true;
}

#[\ReturnTypeWillChange]
public function close() {
return true;
}

#[\ReturnTypeWillChange]
public function read($session_id) {
$file = session_save_path() . '/sess_' . $session_id;

Expand All @@ -33,6 +32,7 @@ public function read($session_id) {
return null;
}

#[\ReturnTypeWillChange]
public function write($session_id, $data) {
$file = session_save_path() . '/sess_' . $session_id;

Expand All @@ -51,15 +51,12 @@ public function write($session_id, $data) {
return true;
}

#[\ReturnTypeWillChange]
public function destroy($session_id) {
$file = session_save_path() . '/sess_' . $session_id;

if (is_file($file)) {
unlink($file);
}
}

public function gc($maxlifetime) {
return parent::gc($maxlifetime);
}
}
29 changes: 1 addition & 28 deletions upload/system/library/session/native.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,4 @@
<?php
namespace Session;
class Native extends \SessionHandler {
public function create_sid() {
return parent::create_sid();
}

public function open($path, $name) {
return parent::open($path, $name);
}

public function close() {
return parent::close();
}

public function read($session_id) {
return parent::read($session_id);
}

public function write($session_id, $data) {
return parent::write($session_id, $data);
}

public function destroy($session_id) {
return parent::destroy($session_id);
}

public function gc($maxlifetime) {
return parent::gc($maxlifetime);
}
}
}

0 comments on commit add5d1e

Please sign in to comment.