summaryrefslogtreecommitdiff
path: root/thread.php
diff options
context:
space:
mode:
Diffstat (limited to 'thread.php')
-rw-r--r--thread.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/thread.php b/thread.php
index 7eb0e88..d6d01f8 100644
--- a/thread.php
+++ b/thread.php
@@ -15,6 +15,10 @@ function add_quote($dbc, $thread_id, $matches) {
$reply = mysqli_fetch_assoc($result);
+ if (empty($reply)) {
+ return '<blockquote>Invalid quote!</blockquote>';
+ }
+
return '<blockquote><a href="#' . $id + 1 .'">Quote from ' . $reply['user_name'] . '</a><br>' . $reply['post_content'] . '</blockquote>';
}
}
@@ -69,7 +73,7 @@ if (mysqli_num_rows($result) == 0) {
'<br><iframe class="youtube-embed" src="//www.youtube.com/embed/$2" allowfullscreen></iframe>', $post_content);
$post_content = preg_replace('/(https?:\/\/[^ ]+?(?:\.jpg|\.png|\.gif))/', '<img class="image-embed" src="$1" alt="$1" />', $post_content);
-
+ //$post_content = preg_replace('/^>/', '<span class="greentext">garb</span>', $post_content);
$post_content = preg_replace('@\b(http(s)?://)?([^\s]*?(?:\.[a-z\d?=/_-]+)+)(?![^<]*?(?:</\w+>|/?>))@i', '<a href="http$2://$3">$0</a>', $post_content);
echo '<td class="post-content">' . $post_content . '</td></tr>';