解决Wordpress的Warning: Missing argument 2 for wpdb:prepare()

有一个WordPress的博客站点,在升级到新版本程序后页面底部出现问题:Warning: Missing argument 2 for wpdb:prepare()

百度之后找到问题原因:3.5版本WordPress中为了安全而做的一个改动,是为了避免SQL注入所引起的安全问题!

只需要找到主题的footer.php文件修改一下就可以了。

  • 修改前是:WHERE post_date_gmt > 1970"));
  • 修改后是:WHERE post_date_gmt >%d",'1970'));

修改完成就可以了。

 

上一篇: Linux下使用iptables禁止某IP访问
下一篇: 解决LNMP 1.2版本程序生成的.user.ini无法删除的问题

发表评论


数据库出错:

MySQL Query Error
Mysql error description: Duplicate entry '0' for key 'uid'
Mysql error number: 1062
Date: 2024-06-03 @ 06:31
Script: http://blog.is36.com/index.php/module/action/param1/tagslist/page/3/user/%E6%AD%A3%E5%86%B0/wap/comments/archives/484/category/technology_all/links/date/202207/archives/487/archives/489/links/archives/436/tagslist/tagslist/templates/default/?action=show&id=410