PHP 8.2 - Community Input
-
Omar_one
- Senior Contributor
- Posts: 677
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: PHP 8.2 - Community Input
The strftime() function has been DEPRECATED as of PHP 8.1.0. Relying on this function is highly discouraged.
- burt
- Core Team
- Posts: 4550
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: PHP 8.2 - Community Input
https://github.com/CE-PhoenixCart/Phoen ... ef937b1c02
&
https://github.com/CE-PhoenixCart/Phoen ... b4f00562fc
is the start of PHP8 Compat changes. Note that these changes will (probably) not solve every error, but will help in reducing the number of issues written to error-log (which will obviously make it easier to spot new issues).
In making these commits I opened every page in Phoenix [admin side & shop side] (checking the error_log as I was going along), however I did not perform every option that a page can do (eg "edit", "delete" etc etc).
--
The needed strftime changes will be addressed in a future version of Phoenix.
--
Please continue to post any issues in this thread. TY.
&
https://github.com/CE-PhoenixCart/Phoen ... b4f00562fc
is the start of PHP8 Compat changes. Note that these changes will (probably) not solve every error, but will help in reducing the number of issues written to error-log (which will obviously make it easier to spot new issues).
In making these commits I opened every page in Phoenix [admin side & shop side] (checking the error_log as I was going along), however I did not perform every option that a page can do (eg "edit", "delete" etc etc).
--
The needed strftime changes will be addressed in a future version of Phoenix.
--
Please continue to post any issues in this thread. TY.
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.
-
Omar_one
- Senior Contributor
- Posts: 677
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: PHP 8.2 - Community Input
which changes is right on admin/includes/classes/message_stack.php
adding
Code: Select all
#[\AllowDynamicProperties]Code: Select all
class messageStack {Code: Select all
class messageStack extends \stdClass{Thank you
- burt
- Core Team
- Posts: 4550
- Joined: Tue Oct 29, 2019 9:37 am
- Phoenix Version: v1.1.0.8
- : Buy Me A Beverage
- Has thanked: 252 times
- Been thanked: 412 times
Re: PHP 8.2 - Community Input
Not this:
extends \stdClass
extends \stdClass
I am not here to build for you.
I am here to build with you. Let's help each other.
I am here to build with you. Let's help each other.
-
Omar_one
- Senior Contributor
- Posts: 677
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: PHP 8.2 - Community Input
admin error file
lines 25-35
Code: Select all
PHP Deprecated: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/shop/public_html/admin/includes/functions/html_output.php on line 27Code: Select all
function phoenix_normalize($attributes) {
$parameters = [];
foreach (preg_split('{"[^"]*"(*SKIP)(*FAIL)|\s+}', $attributes) as $parameter) {
$pair = explode('=', $parameter, 2);
if (!empty($pair[0])) {
$parameters[$pair[0]] = isset($pair[1]) ? trim($pair[1], '"') : null;
}
}
return $parameters;
}-
Omar_one
- Senior Contributor
- Posts: 677
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: PHP 8.2 - Community Input
admin error file
lines from 221-231
line 33-35
Code: Select all
PHP Deprecated: substr(): Passing null to parameter #1 ($string) of type string is deprecated in /home/shop/public_html/includes/apps/paypal/OSCOM_PayPal.php on line 238Code: Select all
if ( $type == 'email') {
return constant('OSCOM_APP_PAYPAL_SANDBOX_SELLER_EMAIL');
} elseif ( $type == 'email_primary') {
return constant('OSCOM_APP_PAYPAL_SANDBOX_SELLER_EMAIL_PRIMARY');
} elseif ( substr($type, 0, 7) == 'payflow' ) {
return constant('OSCOM_APP_PAYPAL_PF_SANDBOX_' . strtoupper(substr($type, 8)));
} else {
return constant('OSCOM_APP_PAYPAL_SANDBOX_API_' . strtoupper($type));
}
}Code: Select all
PHP Deprecated: Function utf8_encode() is deprecated in /home/shop/public_html/includes/apps/paypal/api/GetBalance.php on line 34Code: Select all
foreach ( $params as $key => $value ) {
$post_string .= $key . '=' . urlencode(utf8_encode(trim($value))) . '&';
}
Last edited by Omar_one on Fri Nov 24, 2023 5:07 pm, edited 1 time in total.
-
Omar_one
- Senior Contributor
- Posts: 677
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: PHP 8.2 - Community Input
admin error file
lines from 43-47
Code: Select all
PHP Deprecated: Function strftime() is deprecated in /home/shop/public_html/includes/system/versioned/1.0.8.3/date.php on line 45Code: Select all
public function format($format) {
return $this->timestamp
? strftime($format, $this->timestamp)
: false;
}-
Omar_one
- Senior Contributor
- Posts: 677
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: PHP 8.2 - Community Input
admin error file
line 18-20
line 16-18
Code: Select all
PHP Deprecated: Creation of dynamic property sc_fopen_wrapper::$title is deprecated in /home/shop/public_html/admin/includes/modules/security_check/sc_fopen_wrapper.php on line 19
Code: Select all
public function __construct() {
$this->title = MODULE_SECURITY_CHECK_FOPEN_WRAPPER_TITLE;
}Code: Select all
PHP Deprecated: Creation of dynamic property sc_github_directory::$title is deprecated in /home/shop/public_html/admin/includes/modules/security_check/sc_github_directory.php on line 17Code: Select all
public function __construct() {
$this->title = MODULE_SECURITY_CHECK_GITHUB_TITLE;
}-
Omar_one
- Senior Contributor
- Posts: 677
- Joined: Fri Oct 25, 2019 5:06 pm
- Phoenix Version: v1.0.8.16
- Has thanked: 100 times
- Been thanked: 56 times
Re: PHP 8.2 - Community Input
shop side error_log file
lines 81-90
lines 36-39
lines 29-34
Code: Select all
PHP Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /home/shop/public_html/includes/modules/content/header/cm_header_breadcrumb.php on line 87
Code: Select all
foreach ($breadcrumb->_trail as $i => $v) {
$schema_breadcrumb['itemListElement'][] = [
'@type' => 'ListItem',
'position' => "$i",
'item' => [
'@id' => "{$v['link']}",
'name' => strip_tags($v['title']),
],
];
}Code: Select all
PHP Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /home/shop/public_html/includes/modules/header_tags/ht_twitter_product_card.php on line 36
Code: Select all
$product_description = substr(trim(preg_replace('{\s\s+}', ' ', strip_tags($product->get('description')))), 0, 197);
if ( strlen($product_description) == 197 ) {
$product_description .= ' ..';
}Code: Select all
PHP Deprecated: Creation of dynamic property i_adverts::$advert_width is deprecated in /home/shop/public_html/includes/modules/pi/index/i_adverts.php on line 32Code: Select all
if ( $this->enabled ) {
$this->group = 'i_modules_' . strtolower(I_ADVERTS_GROUP ?? '');
$this->content_width = I_ADVERTS_CONTENT_WIDTH;
$this->advert_width = I_ADVERTS_ADVERT_WIDTH;
}
}-
raiwa
- Certified Developer
- Posts: 1640
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Has thanked: 70 times
- Been thanked: 152 times
Re: PHP 8.2 - Community Input
Probably for the first case:
And similar for others.
Code: Select all
strip_tags($v['title']?? '')Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27