diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 4926ea1440..8d1223f1ce 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -757,7 +757,7 @@ if ($row = $db->sql_fetchrow($result))
// If we allow users to disable display of emoticons
// we'll need an appropriate check and preg_replace here
- $message = (empty($row['enable_smilies']) || empty($config['enable_smilies'])) ? preg_replace('#
#', '\1', $message) : str_replace('