From 0b3fd0231b88582afe59d6d40d481c9fef05a2fd Mon Sep 17 00:00:00 2001 From: ONEXIN Date: Sun, 31 Jan 2021 10:52:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E8=A1=A5=E5=85=A8?= =?UTF-8?q?=E5=8D=8F=E8=AE=AEtel/magnet=E9=93=BE=E6=8E=A5=E8=A7=A3?= =?UTF-8?q?=E6=9E=90js=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- upload/static/js/bbcode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upload/static/js/bbcode.js b/upload/static/js/bbcode.js index 0ca6b8662..67f0b8d7a 100644 --- a/upload/static/js/bbcode.js +++ b/upload/static/js/bbcode.js @@ -77,7 +77,7 @@ function bbcode2html(str) { if(!fetchCheckbox('bbcodeoff') && allowbbcode) { str = clearcode(str); str = str.replace(/\[url\]\s*((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.)([^\[\"']+?)\s*\[\/url\]/ig, function($1, $2, $3, $4) {return cuturl($2 + $4);}); - str = str.replace(/\[url=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.|mailto:)?([^\r\n\[\"']+?)\]([\s\S]+?)\[\/url\]/ig, '$4'); + str = str.replace(/\[url=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.|mailto:|tel:|magnet:)?([^\r\n\[\"']+?)\]([\s\S]+?)\[\/url\]/ig, '$4'); str = str.replace(/\[email\](.[^\\=[]*)\[\/email\]/ig, '$1'); str = str.replace(/\[email=(.[^\\=[]*)\](.*?)\[\/email\]/ig, '$2'); str = str.replace(/\[postbg\]\s*([^\[\<\r\n;'\"\?\(\)]+?)\s*\[\/postbg\]/ig, function($1, $2) { @@ -157,7 +157,7 @@ function bbcode2html(str) { function clearcode(str) { str= str.replace(/\[url\]\[\/url\]/ig, '', str); - str= str.replace(/\[url=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.|mailto:)?([^\s\[\"']+?)\]\[\/url\]/ig, '', str); + str= str.replace(/\[url=((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.|mailto:|tel:|magnet:)?([^\s\[\"']+?)\]\[\/url\]/ig, '', str); str= str.replace(/\[email\]\[\/email\]/ig, '', str); str= str.replace(/\[email=(.[^\[]*)\]\[\/email\]/ig, '', str); str= str.replace(/\[color=([^\[\<]+?)\]\[\/color\]/ig, '', str); -- Gitee