You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am occasionally getting this error when estimating shipping for Auspost: Notice: Undefined offset: 1 in /catalog/model/shipping/auspost.php on line 79
The reason this is happening is that the response from Austpost sometimes contains an extra line break at the end. Which means that when list($key, $value) = explode('=', $part); is called on line 79 it fails since $part is empty.
To fix this I changed $parts = explode("\n", $response); to $parts = explode("\n", trim($response)); on line 36 and 76.
The text was updated successfully, but these errors were encountered:
Just a small follow up issue, on those same two lines we should really be exploding on "\r\n" otherwise all but the last parts end up with a \r still in them.
Not a huge issue but it breaks the html and causes a space if we want to add text to the results without spaces
(i.e. I have mine adding 1 day to the results so it shows 1-2 days rather than just the 1 day returned by auspost, but the newline will cause a space after the 1.)
savage4pro
pushed a commit
to savage4pro/opencart
that referenced
this issue
Dec 7, 2015
I am occasionally getting this error when estimating shipping for Auspost:
Notice: Undefined offset: 1 in /catalog/model/shipping/auspost.php on line 79
The reason this is happening is that the response from Austpost sometimes contains an extra line break at the end. Which means that when
list($key, $value) = explode('=', $part);
is called on line 79 it fails since $part is empty.To fix this I changed
$parts = explode("\n", $response);
to$parts = explode("\n", trim($response));
on line 36 and 76.The text was updated successfully, but these errors were encountered: