我想知道如何调整我的 BBcode 解析器以不解析 URL 中的笑脸?
这是我的解析器:
$smilies = array(
"><" => '<img src="/jscripts/sce/emoticons/angry.png" alt="" />',
":'(" => '<img src="/jscripts/sce/emoticons/cry.png" alt="" />',
":S" => '<img src="/jscripts/sce/emoticons/dizzy.png" alt="" />',
":D" => '<img src="/jscripts/sce/emoticons/grin.png" alt="" />',
"^_^" => '<img src="/jscripts/sce/emoticons/happy.png" alt="" />',
"<3" => '<img src="/jscripts/sce/emoticons/heart.png" alt="" />',
":huh:" => '<img src="/jscripts/sce/emoticons/huh.png" alt="" />',
":|" => '<img src="/jscripts/sce/emoticons/pouty.png" alt="" />',
":(" => '<img src="/jscripts/sce/emoticons/sad.png" alt=""/>',
":O" => '<img src="/jscripts/sce/emoticons/shocked.png" alt="" />',
":sick:" => '<img src="/jscripts/sce/emoticons/sick.png" alt="" />',
":)" => '<img src="/jscripts/sce/emoticons/smile.png" alt="" />',
":P" => '<img src="/jscripts/sce/emoticons/tongue.png" alt="" />',
":S" => '<img src="/jscripts/sce/emoticons/unsure.png" alt="" />',
":woot:" => '<img src="/jscripts/sce/emoticons/w00t.png" alt="" />',
":whistle:" => '<img src="/jscripts/sce/emoticons/whistle.png" alt="" />',
";)" => '<img src="/jscripts/sce/emoticons/wink.png" alt="" />',
":wub:" => '<img src="/jscripts/sce/emoticons/wub.png" alt="" />'
);
$body = str_replace( array_keys( $smilies ), array_values( $smilies ), $body );
问题出现了,因为有人放了一个链接
http://pcgamingwiki.com/wiki/User:Soeb
然后哪个尝试放入“:S”笑脸图像?