Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Deprecated Ereg server_info.php


Guest

Recommended Posts

Hello,

 

I noticed that when upgrading an RC2a cart to PHP 5.3 using the Patches the server_info.php code is incorrect.

 

It states to find this:

 

ereg('<body>(.*)</body>', $phpinfo, $regs);

 

and replace it with this:

 

preg_match('/<body>(.*)<\/body>/', $phpinfo, $regs);

 

Unfortunately, if you do this, the server info is NOT displayed. I tried playing around with different variations of that code but could not find a solution.

 

Could anyone offer some insight into the error ?

 

Chris

Link to comment
Share on other sites

I noticed that when upgrading an RC2a cart to PHP 5.3 using the Patches the server_info.php code is incorrect.

 

It states to find this:

 

ereg('<body>(.*)</body>', $phpinfo, $regs);

 

and replace it with this:

 

preg_match('/<body>(.*)<\/body>/', $phpinfo, $regs);

 

Unfortunately, if you do this, the server info is NOT displayed. I tried playing around with different variations of that code but could not find a solution.

That's correct. It needs two arguments in that line to work:

 

preg_match('/<body>(.*)<\/body>/is', $phpinfo, $regs);

 

Someone told Mark Evans is needs msi to work correctly instead of is but so far Mark found is to work consistently everywhere he could test.

Link to comment
Share on other sites

Thank you Jan, Adding the second argument did the trick. I will update the file for that.

 

Thank you for the input Jan.

 

 

 

Chris

Link to comment
Share on other sites

I'm surprised that "i" is needed as a flag, as the original ereg() was case-sensitive (eregi() for case-insensitive). Of course, allowing <BODY> in addition to <body> is probably an improvement, but still, if the original ereg() worked... The "s" is to make "." match newlines, and "m" is for multiline matching. Obviously, the desired match is likely to cover multiple lines, but I'm not sure how the "m" and "s" flags interact.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...