2011-02-06 40 views
2

我在Wordpress網站上安裝了"Tooltip Glossary「插件,但在輸入了一些包含HTML標籤的條目之後,它基本上停止工作了,我從所有有問題的詞彙表中刪除了標籤preg_replace()未知修飾符(Wordpress詞彙表插件)

警告:preg_replace函數()[function.preg替換]:未知的修飾詞 'b' 在/afs/ir.stanford.edu/group/hopes/,但我現在在每個頁面上獲取這些錯誤消息cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary.php on line 90

Warning:preg_replace()[function.preg-replace]:/afs/ir.stanford中的未知修飾符'b'。 EDU /克在線101

警告:preg_replace()[function.preg-replace]:在/ afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary.php on line 90

Warning:preg_replace()[function.preg-replace]:Unknown modifier' d'in line 101上的/afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary.php

Warning:preg_replace()[function.preg-替換]:關於lin /afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary.php中的未知修飾符'l' e 90

Warning:preg_replace()[function.preg-replace]:/afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/中的未知修飾符'l' tooltipglossary/glossary.php on line 101

有人可以幫我弄清楚有什麼問題嗎?我已上載該插件這裏的php文件:http://www.box.net/shared/1nonkcm9yq

具體來說,行90

$ content_temp =的preg_replace($ glossary_search,$ glossary_replace,$內容);

和線101是

$ content_temp = preg_replace函數($ link_search,$ link_replace,$ content_temp);

非常感謝!

回答

2

您的標題中有一個正斜槓。它違反了正則表達式,因爲/也是外部分隔符。

您需要添加preg_quote(),其中$ glossary_search構造(行83):

$glossary_title = $glossary_item->post_title; 
$glossary_title = preg_quote($glossary_title, "/"); 
$glossary_search = '/\b'.$glossary_title.'s*?\b(?=([^"]*"[^"]*")*[^"]*$)/i'; 

而且還行94:

$link_search = '/<a'.$timestamp.'>('.preg_quote($glossary_item->post_title, "/").'[A-Za-z]*?)<\/a'.$timestamp.'>/i'; 
+0

你只要讓我很快樂。非常感謝! – Stephanie 2011-02-06 00:44:24

相關問題