最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Does Wordpress disable system functions?

programmeradmin3浏览0评论

One of my plugins reports base64_encode as missing. I checked my php.ini and know that this function is working before Wordpress loads. Does Wordpress have the habit of disabling functions?

This is the code that checks for the functions:

if (!function_exists('base64_decode') || !function_exists('base64_encode')) {
    exit("base64 missing");
}

This works if placed before Wordpress loads. The exact same code is run by the plugin and it fails. What could have happened in-between.

One of my plugins reports base64_encode as missing. I checked my php.ini and know that this function is working before Wordpress loads. Does Wordpress have the habit of disabling functions?

This is the code that checks for the functions:

if (!function_exists('base64_decode') || !function_exists('base64_encode')) {
    exit("base64 missing");
}

This works if placed before Wordpress loads. The exact same code is run by the plugin and it fails. What could have happened in-between.

Share Improve this question asked Jan 21, 2020 at 14:54 FedericoFederico 1011 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

WP by itself does not disable those functions. This is a security mechanism of one of your plugins or theme that is disabling them. It is common practice for malicious code to be hidden by encoding it, and then decoding and executing it when the site loads.

You can disable plugins one by one until the function works to determine which one is disabling it. Logically any security related plugins would likely be the one's doing it, and with good reason, i.e. Wordfence, Sucuri, etc.

发布评论

评论列表(0)

  1. 暂无评论