From e5a30f7c098c16ec24d07beb94fafb796ce070f8 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Mon, 3 Oct 2011 18:52:16 +1100 Subject: [PATCH] incorrectly escaped HTML on a now non-existent mod noticeboard post --- mod.php | 10 ++++++---- 1 file 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' => '???'); - } + $_mod = $m_query->fetch(); $body .= '
' . (hasPermission($config['mod']['noticeboard_delete']) ? @@ -538,7 +536,11 @@ 'no subject' ) . ' — by ' . - utf8tohtml($_mod['username']) . + ($_mod ? + utf8tohtml($_mod['username']) + : + '???' + ) . ' at ' . date($config['post_date'], $notice['time']) . '

' . $notice['body'] . '

';