notify('<strong>' . get_string('error') . '</strong>');
}
// these two may go to difference places
- debugging($db->ErrorMsg() .'<br /><br />'. $command);
+ debugging($db->ErrorMsg() .'<br /><br />'. s($command));
if (!empty($CFG->dblogerror)) {
$debug=array_shift(debug_backtrace());
error_log("SQL ".$db->ErrorMsg()." in {$debug['file']} on line {$debug['line']}. STATEMENT: $command");
$rs = $db->Execute($sql);
}
if (!$rs) {
- debugging($db->ErrorMsg() .'<br /><br />'. $sql);
+ debugging($db->ErrorMsg() .'<br /><br />'. s($sql));
if (!empty($CFG->dblogerror)) {
$debug=array_shift(debug_backtrace());
error_log("SQL ".$db->ErrorMsg()." in {$debug['file']} on line {$debug['line']}. STATEMENT: $sql with limits ($limitfrom, $limitnum)");
/// Strip potential LIMIT uses arriving here, debugging them (MDL-7173)
$newsql = preg_replace('/ LIMIT [0-9, ]+$/is', '', $sql);
if ($newsql != $sql) {
- debugging('Incorrect use of LIMIT clause (not cross-db) in call to get_field_sql(): ' . $sql, DEBUG_DEVELOPER);
+ debugging('Incorrect use of LIMIT clause (not cross-db) in call to get_field_sql(): ' . s($sql), DEBUG_DEVELOPER);
$sql = $newsql;
}
$rs = $db->Execute($sql);
if (!$rs) {
- debugging($db->ErrorMsg() .'<br /><br />'. $sql);
+ debugging($db->ErrorMsg() .'<br /><br />'. s($sql));
if (!empty($CFG->dblogerror)) {
$debug=array_shift(debug_backtrace());
error_log("SQL ".$db->ErrorMsg()." in {$debug['file']} on line {$debug['line']}. STATEMENT: $sql");
$sql = 'UPDATE '. $CFG->prefix . $table .' SET '.$update.' '.$select;
$rs = $db->Execute($sql);
if (!$rs) {
- debugging($db->ErrorMsg() .'<br /><br />'. $sql);
+ debugging($db->ErrorMsg() .'<br /><br />'. s($sql));
if (!empty($CFG->dblogerror)) {
$debug=array_shift(debug_backtrace());
error_log("SQL ".$db->ErrorMsg()." in {$debug['file']} on line {$debug['line']}. STATEMENT: $sql");
$sql = 'DELETE FROM '. $CFG->prefix . $table .' '. $select;
$rs = $db->Execute($sql);
if (!$rs) {
- debugging($db->ErrorMsg() .'<br /><br />'. $sql);
+ debugging($db->ErrorMsg() .'<br /><br />'. s($sql));
if (!empty($CFG->dblogerror)) {
$debug=array_shift(debug_backtrace());
error_log("SQL ".$db->ErrorMsg()." in {$debug['file']} on line {$debug['line']}. STATEMENT: $sql");
$sql = 'DELETE FROM '. $CFG->prefix . $table .' '. $select;
$rs = $db->Execute($sql);
if (!$rs) {
- debugging($db->ErrorMsg() .'<br /><br />'. $sql);
+ debugging($db->ErrorMsg() .'<br /><br />'. s($sql));
if (!empty($CFG->dblogerror)) {
$debug=array_shift(debug_backtrace());
error_log("SQL ".$db->ErrorMsg()." in {$debug['file']} on line {$debug['line']}. STATEMENT: $sql");
/// Run the SQL statement
if (!$rs = $db->Execute($insertSQL)) {
- debugging($db->ErrorMsg() .'<br /><br />'.$insertSQL);
+ debugging($db->ErrorMsg() .'<br /><br />'.s($insertSQL));
if (!empty($CFG->dblogerror)) {
$debug=array_shift(debug_backtrace());
error_log("SQL ".$db->ErrorMsg()." in {$debug['file']} on line {$debug['line']}. STATEMENT: $insertSQL");
}
if (!$rs = $db->Execute('UPDATE '. $CFG->prefix . $table .' SET '. $update .' WHERE id = \''. $dataobject->id .'\'')) {
- debugging($db->ErrorMsg() .'<br /><br />UPDATE '. $CFG->prefix . $table .' SET '. $update .' WHERE id = \''. $dataobject->id .'\'');
+ debugging($db->ErrorMsg() .'<br /><br />UPDATE '. $CFG->prefix . $table .' SET '. s($update) .' WHERE id = \''. $dataobject->id .'\'');
if (!empty($CFG->dblogerror)) {
$debug=array_shift(debug_backtrace());
error_log("SQL ".$db->ErrorMsg()." in {$debug['file']} on line {$debug['line']}. STATEMENT: UPDATE $CFG->prefix$table SET $update WHERE id = '$dataobject->id'");
$sql = 'SELECT '.$column.' FROM '.$CFG->prefix.$table.' WHERE 1=2';
if(!$rs = $db->Execute($sql)) {
- debugging($db->ErrorMsg() .'<br /><br />'. $sql);
+ debugging($db->ErrorMsg() .'<br /><br />'. s($sql));
if (!empty($CFG->dblogerror)) {
$debug=array_shift(debug_backtrace());
error_log("SQL ".$db->ErrorMsg()." in {$debug['file']} on line {$debug['line']}. STATEMENT: $sql");
if (!$db->UpdateClob($CFG->prefix.$table, $key, $value, $sqlcondition)) {
$status = false;
$statement = "UpdateClob('$CFG->prefix$table', '$key', '" . substr($value, 0, 100) . "...', '$sqlcondition')";
- debugging($db->ErrorMsg() ."<br /><br />$statement");
+ debugging($db->ErrorMsg() ."<br /><br />".s($statement));
if (!empty($CFG->dblogerror)) {
$debug=array_shift(debug_backtrace());
error_log("SQL ".$db->ErrorMsg()." in {$debug['file']} on line {$debug['line']}. STATEMENT: $statement");
if(!$db->UpdateBlob($CFG->prefix.$table, $key, $value, $sqlcondition)) {
$status = false;
$statement = "UpdateBlob('$CFG->prefix$table', '$key', '" . substr($value, 0, 100) . "...', '$sqlcondition')";
- debugging($db->ErrorMsg() ."<br /><br />$statement");
+ debugging($db->ErrorMsg() ."<br /><br />".s($statement));
if (!empty($CFG->dblogerror)) {
$debug=array_shift(debug_backtrace());
error_log("SQL ".$db->ErrorMsg()." in {$debug['file']} on line {$debug['line']}. STATEMENT: $statement");