Forums / Contribution-Writing Guidelines / Is this a correct code change for PHP 5.3?

Is this a correct code change for PHP 5.3?

Started by dbltoe on 12 Sep 2012, 6:54 PM · Views: 2,889

Results 1 to 8 of 8
12 Sep 2012, 6:54 PM
#1
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,892
Plugin Contributions:
20

Is this a correct code change for PHP 5.3?

File has> $value = ereg_replace("[\r\n\t ]+",' ',$value);Changed to> $value = preg_replace("/[\r\n\t ]+/",' ',$value);Am I on the right track?
Not getting any errors, but wanted to check before submitting a change to a mod.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

12 Sep 2012, 7:57 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Is this a correct code change for PHP 5.3?

.
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.

12 Sep 2012, 8:10 PM
#4
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,892
Plugin Contributions:
20

Re: Is this a correct code change for PHP 5.3?

Yep, saw the blog when it was posted but the example was a little different. Was having no errors in testing but thought I'd throw it out before posting the change.

Great info DrByte!
THANX

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

13 Sep 2012, 3:09 PM
#5
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,892
Plugin Contributions:
20

Re: Is this a correct code change for PHP 5.3?

And thanx to Glenn for taking a look.

Another check to verify I'm reading correctly....> split('|'),0,{})in .js would become> explode('|'),0,{})Or am I in the wrong ballpark?

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

13 Sep 2012, 3:48 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Is this a correct code change for PHP 5.3?

If that's truly javascript and not PHP then there probably is no need to change it.

.
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.

13 Sep 2012, 3:50 PM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,892
Plugin Contributions:
20

Re: Is this a correct code change for PHP 5.3?

It's at the end of a compressed .js file so I'm not really able to tell. I'll defer to no change for now.
THANX again.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

13 Sep 2012, 9:04 PM
#8
terragirl avatar

terragirl

Zen Follower

Join Date:
Jun 2010
Location:
Austria
Posts:
123
Plugin Contributions:
0

Re: Is this a correct code change for PHP 5.3?

If it's a .js file then it's javascript, not PHP so no worries about PHP5.3 for that one.