#8577 closed defect (bug) (fixed)
Attempts to use curl cause warnings on some hosts
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.7.1 |
| Component: | General | Version: | 2.7 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
Some 2.7 users are getting these messages:
Warning: curl_exec() has been disabled for security reasons in /home/nicetec/public_html/wp-includes/http.php on line 1022
Warning: curl_exec() has been disabled for security reasons in /home/nicetec/public_html/wp-includes/http.php on line 1027
Warning: Cannot modify header information - headers already sent by (output started at /home/nicetec/public_html/wp-includes/http.php:1022) in /home/nicetec/public_html/wp-includes/pluggable.php on line 850
Apparently, when a paranoid host decides to disable curl, even attempting to use it can cause a warning.
However, the real problem is that the only check for curl capability is "function_exists('curl_init')". While function_exists will return false for disabled functions, it's not checking all of them. Although why a host would disable curl_exec and not curl_init is beyond me, I admit.
Attachments (1)
Change History (6)
comment:2
sivel
— 5 years ago
This is usually done by adding functions to disable_functions in php.ini
Attached is a patch that will exclude curl if curl_ exists in disable_functions.
comment:3
sivel
— 5 years ago
Hmmm...apparently I was too quick to jump for that resolution. just check for both curl_init and curl_exec.
References:
http://wordpress.org/support/topic/224167
http://wordpress.org/support/topic/224169