Several sizeof errors
Posted: Mon Oct 13, 2025 4:20 pm
I am installing a new USPS shipping module into my old store, and I am receiving several sizeof() errors.
One is in /includes/classes/shipping.php. I have found that I can address the error if I make this edit:
The second is in /checkout_shipping.php. I have found that I can address this error if I make this edit:
Does anyone see a problem with either of these two 'fixes'?
1) Yes, these are 'core' changes. I do not have a problem with that.
2) Yes, the *source* of these problems in the new USPS add-on, and I am only treating the symptoms.
3) Yes, this is an old version of Phoenix (1.0.3.0), and these 'problems' MAY have been addressed in newer versions.
Thanks in advance!
Malcolm
Phoenix 1.0.3.0
PHP 7.4.33
One is in /includes/classes/shipping.php. I have found that I can address the error if I make this edit:
Code: Select all
// for ($i=0, $n=sizeof($quotes['methods']); $i<$n; $i++) {
for ($i=0, $n=sizeof((array)$quotes['methods']); $i<$n; $i++) {
Code: Select all
// for ($j=0, $n2=sizeof($quotes[$i]['methods']); $j<$n2; $j++) {
for ($j=0, $n2=sizeof($quotes[$i]['methods'] ?? []); $j<$n2; $j++) {
1) Yes, these are 'core' changes. I do not have a problem with that.
2) Yes, the *source* of these problems in the new USPS add-on, and I am only treating the symptoms.
3) Yes, this is an old version of Phoenix (1.0.3.0), and these 'problems' MAY have been addressed in newer versions.
Thanks in advance!
Malcolm
Phoenix 1.0.3.0
PHP 7.4.33