summaryrefslogtreecommitdiff
path: root/mod.php
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-10-03 18:52:16 +1100
committerSavetheinternet <savetheinternet@tinyboard.org>2011-10-03 18:52:16 +1100
commite5a30f7c098c16ec24d07beb94fafb796ce070f8 (patch)
tree48455b1d252eed817eb1802c52efc60549f96509 /mod.php
parent23cfaf0cd39afe93b93b7f3094e9b64fe7464ae8 (diff)
incorrectly escaped HTML on a now non-existent mod noticeboard post
Diffstat (limited to 'mod.php')
-rw-r--r--mod.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/mod.php b/mod.php
index a5f9a70d..68d142d2 100644
--- a/mod.php
+++ b/mod.php
@@ -523,9 +523,7 @@
$m_query = prepare("SELECT `username` FROM `mods` WHERE `id` = :id");
$m_query->bindValue(':id', $notice['mod'], PDO::PARAM_INT);
$m_query->execute() or error(db_error($m_query));
- if(!$_mod = $m_query->fetch()) {
- $_mod = Array('username' => '<em>???</em>');
- }
+ $_mod = $m_query->fetch();
$body .= '<div class="ban">' .
(hasPermission($config['mod']['noticeboard_delete']) ?
@@ -538,7 +536,11 @@
'<em>no subject</em>'
) .
'<span class="unimportant"> — by ' .
- utf8tohtml($_mod['username']) .
+ ($_mod ?
+ utf8tohtml($_mod['username'])
+ :
+ '<em>???</em>'
+ ) .
' at ' .
date($config['post_date'], $notice['time']) .
'</span></h2><p>' . $notice['body'] . '</p></div>';