Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Deprecated Ereg server_info.php


Guest

Recommended Posts

Posted

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

Posted

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.

Posted

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

 

Thank you for the input Jan.

 

 

 

Chris

Posted

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.

Archived

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

×
×
  • Create New...