diff options
author | Cflip <36554078+cflip@users.noreply.github.com> | 2021-01-28 11:15:59 -0700 |
---|---|---|
committer | Cflip <36554078+cflip@users.noreply.github.com> | 2021-01-28 11:15:59 -0700 |
commit | 64ee5ff9c43b46e6d76f97af4fa2789cd9ea43b3 (patch) | |
tree | fd54c365751da54cad818dd2a970541e0f92b3eb /thread.php | |
parent | e5c06f81e065aad0c711ca3baf578b3c0a4fd8d8 (diff) |
Fixes and style changes
Diffstat (limited to 'thread.php')
-rw-r--r-- | thread.php | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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>'; |