Jump to content

Archived

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

test2123

Turning off error reporting on OsCommerce 2.2

Recommended Posts

Hello,

 

Today I added an extra row in my database to test what happened when violating a key value with which should be unique and it is not.

 

My PHP.INI has:

 

display_error off

display_startup_errors off

http_errror off 

 

and error_reporting E_ALL &  DEPRECATED

 

However, when the oscommerce queried the database and returned more then 1 row (instead of getting only one result as expected) an error was displayed on the user's browser (displaying all the query showing tables names etc etc.)

 

I would like to know how to turn off this behavior and just display a blank page. The style of the error looked like an OsCommerce generated error rather than a PHP error display.

 

Thank you in advance for any advice.

Mika  :)

Share this post


Link to post
Share on other sites

The error message is generated in includes/functions/database.php. Look for this line:

 

 

    die('<font color="#000000"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color="#ff0000">[TEP STOP]</font></small><br><br></b></font>');
 

 

and change it to:

 

 

    die();
 

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Thank you, I think you are correct and you really helped!  :thumbsup:

 

Needless to say that without an extensive knowledge of OsC was impossible to find that print. IMHO that kind of messaging should be controlled by PHP.ini or some obvious system wide variable.

 

Thank you.

Share this post


Link to post
Share on other sites

I know that the point is to prevent customers seeing an error message, but those error messages are useful in finding and fixing rare bugs. I usually change that line to email me the error. I also add some details, such as the file where the error occurred. You could also log the errors to a file.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

×