From c8743140fb9c95727fd9a979e6edf6b31469f0c5 Mon Sep 17 00:00:00 2001 From: haoouba <2323333339@qq.com> Date: Sun, 21 Feb 2021 21:26:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/short.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/core/short.php b/core/short.php index 4c9b3e5..5f9ab3e 100644 --- a/core/short.php +++ b/core/short.php @@ -11,7 +11,7 @@ function _parseContent($post, $login) /* 过滤默认卡片 */ if (strpos($content, '{/card-default}') !== false) { $content = preg_replace_callback( - '/\{card-default\s{0,}width="(.{0,})"\s{0,}label="(.{0,})"\s{0,}\}(.{0,})\{\/card-default\}/sSU', + '/\{card-default\s*width="(.*)"\s*label="(.*)"\s*\}(.*)\{\/card-default\}/sSU', function ($matches) { return ' ' . $matches[2] . ' @@ -26,7 +26,7 @@ function _parseContent($post, $login) /* 过滤消息提示 */ if (strpos($content, '{/message}') !== false) { $content = preg_replace_callback( - '/\{message\s{0,}type="(success|info|warning|error)"\s{0,}\}(.{0,})\{\/message\}/sSU', + '/\{message\s*type="(success|info|warning|error)"\s*\}(.*)\{\/message\}/sSU', function ($matches) { return ' @@ -41,7 +41,7 @@ function _parseContent($post, $login) /* 过滤note button */ if (strpos($content, '{/anote}') !== false) { $content = preg_replace_callback( - '/\{anote\s{0,}icon="(.{0,})"\s{0,}href="(.{0,})"\s{0,}type="(secondary|success|warning|error|info)"\s{0,}}(.{0,})\{\/anote\}/sSU', + '/\{anote\s*icon="(.*)"\s*href="(.*)"\s*type="(secondary|success|warning|error|info)"\s*}(.*)\{\/anote\}/sSU', function ($matches) { return ' ' . $matches[4] . ' @@ -55,7 +55,7 @@ function _parseContent($post, $login) /* 过滤普通button */ if (strpos($content, '{/abtn}') !== false) { $content = preg_replace_callback( - '/\{abtn\s{0,}icon="(.{0,})"\s{0,}color="(.{0,})"\s{0,}href="(.{0,})"\s{0,}radius="(.{0,})"\s{0,}\}(.{0,})\{\/abtn\}/sSU', + '/\{abtn\s*icon="(.*)"\s*color="(.*)"\s*href="(.*)"\s*radius="(.*)"\s*\}(.*)\{\/abtn\}/sSU', function ($matches) { return ' ' . $matches[5] . ' @@ -74,7 +74,7 @@ function _parseContent($post, $login) $content = strtr($content, array("{hide}" => "", "{/hide}" => "")); } else { $content = preg_replace_callback( - '/\{hide\}.{0,}\{\/hide\}/sSU', + '/\{hide\}.*\{\/hide\}/sSU', function () { return '此处内容作者设置了 回复 可见'; }, @@ -86,14 +86,14 @@ function _parseContent($post, $login) /* 过滤网易云音乐 */ if (strpos($content, '{music') !== false) { $content = preg_replace_callback( - '/\{music-list\s{0,}id="(\w{0,})"\s{0,}\/\}/SU', + '/\{music-list\s*id="(\w*)"\s*\/\}/SU', function ($matches) { return ''; }, $content ); $content = preg_replace_callback( - '/\{music\s{0,}id="(\w{0,})"\s{0,}\/\}/SU', + '/\{music\s*id="(\w*)"\s*\/\}/SU', function ($matches) { return ''; }, @@ -104,7 +104,7 @@ function _parseContent($post, $login) /* 过滤dplayer播放器 */ if (strpos($content, '{dplayer') !== false) { $content = preg_replace_callback( - '/\{dplayer\s{0,}src="(.{0,})"\s{0,}\/\}/sSU', + '/\{dplayer\s*src="(.*)"\s*\/\}/sSU', function ($matches) { $player = Helper::options()->JCustomPlayer ? Helper::options()->JCustomPlayer : '/usr/themes/Joe/library/player.php?url='; return ''; @@ -116,7 +116,7 @@ function _parseContent($post, $login) /* 过滤bilibili播放器 */ if (strpos($content, '{bilibili') !== false) { $content = preg_replace_callback( - '/\{bilibili\s{0,}bvid="(\w{0,})"\s{0,}\/\}/sSU', + '/\{bilibili\s*bvid="(\w*)"\s*\/\}/sSU', function ($matches) { return ''; }, @@ -135,7 +135,7 @@ function _parseContent($post, $login) /* 过滤复制粘贴功能 */ if (strpos($content, '{/copy}') !== false) { $content = preg_replace_callback( - '/\{copy\s{0,}text="(.{0,})"\s{0,}\}(.{0,})\{\/copy\}/sSU', + '/\{copy\s*text="(.*)"\s*\}(.*)\{\/copy\}/sSU', function ($matches) { return '' . $matches[2] . ''; },