remove unneccessary quoting and escaping

This commit is contained in:
Isaac Connor 2013-12-06 15:51:36 -05:00
parent 86b04d0e6f
commit a2a3bda2e1
1 changed files with 1 additions and 4 deletions

View File

@ -458,14 +458,11 @@ class Logger
syslog( self::$syslogPriorities[$level], $message );
if ( $level <= $this->databaseLevel )
{
$dbFile = is_null($file)?'NULL':"'".dbEscape($file)."'";
$dbLine = is_null($line)?'NULL':dbEscape($line);
try {
global $dbConn;
$sql = "INSERT INTO Logs ( TimeKey, Component, Pid, Level, Code, Message, File, Line ) values ( ?, ?, ?, ?, ?, ?, ?, ? )";
$stmt = $dbConn->prepare( $sql );
$result = $stmt->execute( array( sprintf( "%d.%06d", $time['sec'], $time['usec'] ), dbEscape($this->id), getmypid(), dbEscape($level), dbEscape($code), dbEscape($string), $dbFile, $dbLine ) );
$result = $stmt->execute( array( sprintf( "%d.%06d", $time['sec'], $time['usec'] ), $this->id, getmypid(), $level, $code, $string, $file, $line ) );
} catch(PDOException $ex) {
$this->databaseLevel = self::NOLOG;
Fatal( "Can't write log entry '$sql': ". $ex->getMessage() );