-
-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果修改了"wp_"表前缀的话,带有评论的页面会无法正确显示 #863
Comments
@0xba1100n,感谢你给 sakurairo 提出了 issue。ヾ(≧▽≦*)o |
那么为什么要修改表名呢 |
🤨 改前缀没有关系才对,我上一年改了都没有问题。 你是用什么方法改的? 我之前是使用插件帮我改的。 |
改变默认设置, 可能是因为安全问题... 对比一其他的安全措施,这个是非常小的一个吧。 |
预想用 |
另外你贴的这个问题是没装 |
作者大大你好(*´▽`)ノ,这个是WordPress建站的时候的可选项,我当时修改这个的目的是为了增加sql注入时猜测表名的难度,比如wp_comments根本就不需要猜,但是我改成了形如1145141919abcd_这样的前缀,当时的想法是制造点小麻烦吧 |
我是直接在wp建站时改的,这个框架大部分功能点都是没有问题的,但唯独就是显示IP属地功能一旦打开,就会引用到这一块写死了表名的代码,然后造成网站页面显示错乱 |
还真是,哈哈没注意到,当时直奔functions.php去了,然后恰好看到那个地方就以为仅仅是那里的问题_(:з」∠)_辛苦作者啦 |
Fatal error: Uncaught Error: Call to undefined function curl_init() in /var/www/html/wp-content/themes/Sakurairo/functions.php:356 Stack trace: #0 /var/www/html/wp-content/themes/Sakurairo/functions.php(399): convertip() #1 /var/www/html/wp-includes/class-walker-comment.php(183): akina_comment_format() #2 /var/www/html/wp-includes/class-wp-walker.php(147): Walker_Comment->start_el() #3 /var/www/html/wp-includes/class-walker-comment.php(139): Walker->display_element() #4 /var/www/html/wp-includes/class-wp-walker.php(390): Walker_Comment->display_element() #5 /var/www/html/wp-includes/comment-template.php(2391): Walker->paged_walk() #6 /var/www/html/wp-content/themes/Sakurairo/comments.php(31): wp_list_comments() #7 /var/www/html/wp-includes/comment-template.php(1618): require('...') #8 /var/www/html/wp-content/themes/Sakurairo/footer.php(16): comments_template() #9 /var/www/html/wp-includes/template.php(790): require_once('...') #10 /var/www/html/wp-includes/template.php(725): load_template() #11 /var/www/html/wp-includes/general-template.php(92): locate_template() #12 /var/www/html/wp-content/themes/Sakurairo/single.php(23): get_footer() #13 /var/www/html/wp-includes/template-loader.php(106): include('...') #14 /var/www/html/wp-blog-header.php(19): require_once('...') #15 /var/www/html/index.php(17): require('...') #16 {main} thrown in /var/www/html/wp-content/themes/Sakurairo/functions.php on line 356
似乎由于functions.php中的"wp_comments"写死,导致如果修改了"wp_"表前缀的话,比如"wp114514_comments",带有评论的页面会无法正确显示
实际上更改functions.php中三个出现wp_comments为XXX_comments以后仍然不能解决问题,后面跟进报错发现原来是convertip函数有问题,于是关闭评论者的ip属地显示功能,就正常了,请作者大大看看是怎么回事_(:з」∠)_
The text was updated successfully, but these errors were encountered: