1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-01 06:20:46 +02:00

Of course it has to be more tricky than that doesn't it ... well, I'm off to bed so it can stick it up its pipe and smoke it for now :D

git-svn-id: file:///svn/phpbb/trunk@3078 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen
2002-11-21 22:46:12 +00:00
parent bb05d733ee
commit aedd730552
4 changed files with 12 additions and 10 deletions

View File

@@ -139,7 +139,7 @@ class sql_db
$endtime = explode(' ', microtime());
$endtime = $endtime[0] + $endtime[1] - $starttime;
$this->sql_report .= "<pre>Query:\t" . preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n\t", $query) . "\n\n";
$this->sql_report .= "<pre>Query:\t" . htmlspecialchars(preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n\t", $query)) . "\n\n";
if ($this->query_result)
{
$this->sql_report .= "Time before: $curtime\nTime after: $endtime\nElapsed time: <b>" . ($endtime - $curtime) . "</b>\n</pre>";
@@ -147,7 +147,7 @@ class sql_db
else
{
$error = $this->sql_error();
$this->sql_report .= '<b>FAILED</b> - MySQL Error ' . $error['code'] . ': ' . $error['message'] . '<br><br><pre>';
$this->sql_report .= '<b>FAILED</b> - MySQL Error ' . $error['code'] . ': ' . htmlspecialchars($error['message']) . '<br><br><pre>';
}
$this->sql_time += $endtime - $curtime;
if (preg_match('/^SELECT/', $query))

View File

@@ -134,12 +134,12 @@ class sql_db
{
$this->sql_error($query);
}
if (!empty($_REQUEST['explain']))
if (!empty($_REQUEST['explain']))
{
$endtime = explode(' ', microtime());
$endtime = $endtime[0] + $endtime[1] - $starttime;
$this->sql_report .= "<pre>Query:\t" . preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n\t", $query) . "\n\n";
$this->sql_report .= "<pre>Query:\t" . htmlspecialchars(preg_replace('/[\s]*[\n\r\t]+[\n\r\s\t]*/', "\n\t", $query)) . "\n\n";
if ($this->query_result)
{
$this->sql_report .= "Time before: $curtime\nTime after: $endtime\nElapsed time: <b>" . ($endtime - $curtime) . "</b>\n</pre>";
@@ -147,7 +147,7 @@ class sql_db
else
{
$error = $this->sql_error();
$this->sql_report .= '<b>FAILED</b> - MySQL Error ' . $error['code'] . ': ' . $error['message'] . '<br><br><pre>';
$this->sql_report .= '<b>FAILED</b> - MySQL Error ' . $error['code'] . ': ' . htmlspecialchars($error['message']) . '<br><br><pre>';
}
$this->sql_time += $endtime - $curtime;
if (preg_match('/^SELECT/', $query))