From 4c9d433ba1c52ad67e4cccabf04e709bb8b85070 Mon Sep 17 00:00:00 2001 From: Cflip <36554078+cflip@users.noreply.github.com> Date: Thu, 28 Jan 2021 17:14:00 -0700 Subject: bug fixes --- thread.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/thread.php b/thread.php index d6d01f8..01ffeaa 100644 --- a/thread.php +++ b/thread.php @@ -19,7 +19,9 @@ function add_quote($dbc, $thread_id, $matches) { return '
Invalid quote!
'; } - return '
Quote from ' . $reply['user_name'] . '
' . $reply['post_content'] . '
'; + $id = $id + 1; + + return '
Quote from ' . $reply['user_name'] . '
' . $reply['post_content'] . '
'; } } @@ -72,9 +74,9 @@ if (mysqli_num_rows($result) == 0) { "/\s*[a-zA-Z\/\/:\.]*youtu(be.com\/watch\?v=|.be\/)([a-zA-Z0-9\-_]+)([a-zA-Z0-9\/\*\-\_\?\&\;\%\=\.]*)/i", '
', $post_content); - $post_content = preg_replace('/(https?:\/\/[^ ]+?(?:\.jpg|\.png|\.gif))/', '$1', $post_content); + $post_content = preg_replace('@\b(http(s)?://)([^\s]*?(?:\.[a-z\d?=/_-]+)+(?:\.jpg|\.png|\.gif))(?![^<]*?(?:|/?>))@i', 'http$2://$3', $post_content); //$post_content = preg_replace('/^>/', 'garb', $post_content); - $post_content = preg_replace('@\b(http(s)?://)?([^\s]*?(?:\.[a-z\d?=/_-]+)+)(?![^<]*?(?:|/?>))@i', '$0', $post_content); + $post_content = preg_replace('@\b(http(s)?://)([^\s]*?(?:\.[a-z\d?=/_-]+)+)(?![^<]*?(?:|/?>))@i', '$0', $post_content); echo '' . $post_content . ''; -- cgit v1.2.3