• 郑州网站建设_网站制作_网页设计_手机建站-郑州建站

  • 手机网站 专注网站建设 品牌的力量 值得信赖

    服务热线: 15136144056/15638281969

当前位置:首页 > 建站知识 > 建站常见问题 > 正文

复制的php代码为什么不能用?老是空白,报500

发布时间:2014年06月25日 10:52 | 发布者:新速科技 | 浏览次数:1759次
记得WP百科网曾发布一篇文章“不用插件实现标题、关键词、描述的SEO优化”,有朋友说复制代码的时候会出错,经过本博客验证,确实如此,最后检查了复制下来的代码,发现原来之前的半角引号等符号都编程了全角符号,这个是导致问题的直接原因,究其原因,原来是因为php代码一个小bug导致的,复制出来的php代码都会默认把原来的半角符号转换为全角符号,既然有问题就必须解决,方法也很简单,只需要修改wordpress程序中的一段代码即可:
修改方法:在wordpress程序中按路径找到 wp-includes/formatting.php 文件,并找到以下代码:
// This is not a tag, nor is the texturization disabled static strings
然后把其后的一段代码:
// This is not a tag, nor is the texturization disabled static strings
$curl = str_replace($static_characters, $static_replacements, $curl);
// regular expressions
$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
}
修改为:
// This is not a tag, nor is the texturization disabled static strings
//$curl = str_replace($static_characters, $static_replacements, $curl);
// regular expressions
//$curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl);
}
看出来了吗?其实就是把带有$curl这个符号的两句注释掉就好了,然后下次别人在复制你的代码的时候就不会出错了哦。