Jus tfor fun, what version of PHP? Mine is 5.2.3
Jus tfor fun, what version of PHP? Mine is 5.2.3
Using the foreach-as approach is fine, and is in fact a more efficient construct than the while(list)=each construct. We are moving more toward the foreach approach progressively as code is updated for PHP5.
Thus, making the change you mentioned will be safe.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Yes, I understand that. My issue is this - how many other times is the construct in question used in the code, and, what impact does it have (since they can break also presumably)? Not knowing the true cause, this is not a good feeling. So, I am updating PHP to the current version, re-testing, and, going to post in some PHP forums.
I've tested Zen Cart 1.3.7 on countless servers with varying PHP configurations and never personally encountered the problem reported by regenbauma.
Even downloading his entire site and putting it on a few of my own servers couldn't recreate the problem he reported ... using the while/list/each code construct.
It's odd that it only seems to affect the $_POST data and not other arrays.
If you do find something about it, that will confirm that changing that line will be helpful for your situation.
Future versions of Zen Cart will have fewer while/list/each constructs in favor of foreach constructs.
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
I hope you are not suggesting what I said is not worth it, it is. Yes, I changed the one line long ago. But, as a programmer who has written a few million lines of code in 30 years of programming, it does not end there. There are two paths:
Either way, the problem is far from solved in my book. Simply changing one line that I know is bad and hoping all is ok is not the way to do things. That's all I was saying.
- IF the problem turns out to be a PHP bug, then, it is my responsibility to file an official bug report so that the problem can be fixed and not cost tens of thousands of programmers time for whatever odd reason it sometimes happens or
- IF the problem turns out to be a real difference in the two constructs, and not a bug, then, I need to go through my Zen Cart code and look for other instances that might have the same construct, and, might not be behaving properly.
BTW - I have the problem on TWO servers, which are running two different OSes and two different PHP5 versions (though close). So, I am 2 for 2.