Closed (fixed)
Project:
Ubercart
Version:
5.x-1.7
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Mar 2009 at 23:58 UTC
Updated:
12 Apr 2009 at 23:40 UTC
I am seeing this error once every day or two in the watchdog on a fairly busy Ubercart 1.7 store:
Invalid argument supplied for foreach() in [...]/sites/all/modules/ubercart/shipping/uc_quote/uc_quote.module on line 1413
This occurs because the JavaScript callback at /cart/checkout/shipping/quote does not check if the POSTed variables are set before using them, though I don't know how this would occur during normal usage of the site. A patch is attached that wraps the affected code in an is_array() check.
| Comment | File | Size | Author |
|---|---|---|---|
| uc_quote.patch | 1.03 KB | longwave |
Comments
Comment #1
longwaveComment #2
jju commentedThnx
Comment #3
rszrama commentedBecause I'm not entirely sure of the implications here, I simple casted $_POST['details'] to an array within that foreach(). I think it'll have the same outcome, it's just less of a patch at this point.