Page 1 of 1

error PHP Deprecated: mysql_escape_string():

Posted: Tue Nov 05, 2019 3:39 am
by dperezgestyde
good morning
Recently update my NagiosXi to version 5.6.7
Now the reports menu takes a long time to load.
Looking at the logs I find this:

PHP Deprecated: mysql_escape_string (): This function is deprecated; use mysql_real_escape_string () instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 372, referr: https: //IP/nagiosxi/includes/components/nocscreen/noc.php

Please can you tell me how to fix it?
thanks greetings

Re: error PHP Deprecated: mysql_escape_string():

Posted: Tue Nov 05, 2019 2:41 pm
by scottwilkerson
This is actually just a test in the software to see if the function is available

Code: Select all

// If we can't use mysql_escape_string then we have to
// just add slashes since we have no open connection
if (function_exists('mysql_escape_string')) {
    $escaped = mysql_escape_string($in);
} else {
    $escaped = addslashes($in);
}
Also, this will not affect reporting performace.

Re: error PHP Deprecated: mysql_escape_string():

Posted: Wed Nov 06, 2019 3:45 am
by dperezgestyde
Good morning ok
And then why does the error appear when I try to get a report?
and because the reports take so long, more than 5 minutes for the report of the day.
Greetings

Re: error PHP Deprecated: mysql_escape_string():

Posted: Wed Nov 06, 2019 8:04 am
by scottwilkerson
I'm not sure what report you are having problem with but the above line was referred by the Operations Screen

Code: Select all

referr: https: //IP/nagiosxi/includes/components/nocscreen/noc.php