preg_replace() 未知修饰符(Wordpress 术语表插件)
我在 WordPress 网站上安装了 "Tooltip Glossary" 插件,但在一些包含 HTML 的条目之后输入标签后,它基本上停止工作。我已经从所有有问题的术语表条目中删除了标签,但现在每个页面上都收到这些错误消息:
警告:preg_replace() [function.preg-replace]:/afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary 中未知修饰符“b” .php 第 90 行
警告:preg_replace() [function.preg-replace]:/afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary 中未知修饰符“b” .php 第 101 行
警告:preg_replace() [function.preg-replace]:/afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary 中未知的修饰符“d” .php 第 90 行
警告:preg_replace() [function.preg-replace]:/afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary 中未知的修饰符“d” .php 第 101 行
警告:preg_replace() [function.preg-replace]:/afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary 中未知修饰符“l” .php 第 90 行
警告:preg_replace() [function.preg-replace]:/afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary 中未知修饰符“l” .php 第 101 行
有人能帮我找出问题所在吗?我已经在这里上传了该插件的 php 文件: http://www.box.net/shared/ 1nonkcm9yq
具体来说,第 90 行是
$content_temp = preg_replace($glossary_search, $glossary_replace, $content);
第 101 行是
$content_temp = preg_replace($link_search, $link_replace, $content_temp);
非常感谢!
I installed the "Tooltip Glossary" plugin on a Wordpress site, but after some entries containing HTML tags were entered, it basically stopped working. I have stripped tags out of all the offending glossary entries, but am now getting these error messages on every page:
Warning: preg_replace() [function.preg-replace]: Unknown modifier 'b' in /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 'b' in /afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary.php on line 101
Warning: preg_replace() [function.preg-replace]: Unknown modifier 'd' in /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 /afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary.php on line 101
Warning: preg_replace() [function.preg-replace]: Unknown modifier 'l' in /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 'l' in /afs/ir.stanford.edu/group/hopes/cgi-bin/wordpress/wp-content/plugins/tooltipglossary/glossary.php on line 101
Can someone help me figure out what's wrong? I've uploaded the php file for the plugin here: http://www.box.net/shared/1nonkcm9yq
Specifically, line 90 is
$content_temp = preg_replace($glossary_search, $glossary_replace, $content);
and line 101 is
$content_temp = preg_replace($link_search, $link_replace, $content_temp);
Thanks so much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的标题中有一个正斜杠。它破坏了正则表达式,因为 / 也是外部分隔符。
您需要在构建 $glossary_search 的位置添加 preg_quote() (第 83 行):
以及第 94 行:
You have a forward slash in your title. It's breaking the regular expression, because / is also the outer delimiter.
You need to add preg_quote() where $glossary_search is constructed (line 83):
And also line 94: