function __construct($error, $sql=null) {
$this->error = $error;
$this->sql = $sql;
- $errorinfo = s($error).'<br /><br />'.s($sql);
+ $errorinfo = $error."\n".$sql;
parent::__construct('ddlexecuteerror', NULL, $errorinfo);
}
}
* @param string $error
*/
function __construct($error) {
- $errorinfo = '<em>'.s($error).'</em>';
+ $errorinfo = $error;
parent::__construct('dbconnectionfailed', NULL, $errorinfo);
}
}
$this->error = $error;
$this->sql = $sql;
$this->params = $params;
- $errorinfo = s($error).'<br /><br />'.s($sql).'<br />['.s(var_export($params, true)).']';
+ $errorinfo = $error."\n".$sql."\n[".var_export($params, true).']';
parent::__construct('dmlreadexception', NULL, $errorinfo);
}
}
* @param array $params
*/
function __construct($sql='', array $params=null) {
- $errorinfo = s($sql).'<br />['.s(var_export($params, true)).']';
+ $errorinfo = $sql."\n[".var_export($params, true).']';
parent::__construct('multiplerecordsfound', null, $errorinfo);
}
}
$errcode = 'invalidrecord';
break;
}
- $errorinfo = s($sql).'<br />['.s(var_export($params, true)).']';
+ $errorinfo = $sql."\n[".var_export($params, true).']';
parent::__construct($errcode, $tablename, $errorinfo);
}
}
$this->error = $error;
$this->sql = $sql;
$this->params = $params;
- $errorinfo = s($error).'<br /><br />'.s($sql).'<br />['.s(var_export($params, true)).']';
+ $errorinfo = $error."\n".$sql."\n[".var_export($params, true).']';
parent::__construct('dmlwriteexception', NULL, $errorinfo);
}
}
if (debugging('', DEBUG_DEVELOPER)) {
if (!empty($debuginfo)) {
- $output .= $this->notification('<strong>Debug info:</strong> '.s($debuginfo), 'notifytiny');
+ $debuginfo = s($debuginfo); // removes all nasty JS
+ $debuginfo = str_replace("\n", '<br />', $debuginfo); // keep newlines
+ $output .= $this->notification('<strong>Debug info:</strong> '.$debuginfo, 'notifytiny');
}
if (!empty($backtrace)) {
$output .= $this->notification('<strong>Stack trace:</strong> '.format_backtrace($backtrace), 'notifytiny');
</div>';
if (!empty($CFG->debug) && $CFG->debug >= DEBUG_DEVELOPER) {
if (!empty($debuginfo)) {
- $content .= '<div class="notifytiny">Debug info: ' . s($debuginfo) . '</div>';
+ $debuginfo = s($debuginfo); // removes all nasty JS
+ $debuginfo = str_replace("\n", '<br />', $debuginfo); // keep newlines
+ $content .= '<div class="notifytiny">Debug info: ' . $debuginfo . '</div>';
}
if (!empty($backtrace)) {
$content .= '<div class="notifytiny">Stack trace: ' . format_backtrace($backtrace, false) . '</div>';