Removing error files/lines whenever an error occured Removing error files/lines whenever an error occured
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Removing error files/lines whenever an error occured

Started by yoshikiwei, September 20, 2004, 07:46:59 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

yoshikiwei

I dont really like the idea of displaying error file/lines to my users when an error occured
like attached picture

therefore i made some changes to functions.inc.php,
this allows only the admin (thats me) to see the error files/lines, and not my users
find
        $params = array(
                '{MESSAGE}' => $msg_text,
                '{FILE_TXT}' => $lang_cpg_die['file'],
                '{FILE}' => $error_file,
                '{LINE_TXT}' => $lang_cpg_die['line'],
                '{LINE}' => $error_line,
                '{OUTPUT_BUFFER}' => $ob,
        );

replace with
if (GALLERY_ADMIN_MODE){
        $params = array(
                '{MESSAGE}' => $msg_text,
                '{FILE_TXT}' => $lang_cpg_die['file'],
                '{FILE}' => $error_file,
                '{LINE_TXT}' => $lang_cpg_die['line'],
                '{LINE}' => $error_line,
                '{OUTPUT_BUFFER}' => $ob,
        );
} else {
        $params = array(
                '{MESSAGE}' => $msg_text,
                '{FILE_TXT}' => "",
                '{FILE}' => "",
                '{LINE_TXT}' => "",
                '{LINE}' => "",
                '{OUTPUT_BUFFER}' => $ob,
        );
}

Joachim Müller

However, if there are errors that only occur when a regular user is logged in (instead of the admin), it's helpfull for trouble-shooting and debuggig to have those lines available. This might be a helpfull little mod if you know your way around in coppermine (you will have to revert to the original code when bug-hunting) though.

Joachim