Ticket #8577 (closed defect (bug): fixed)

Opened 3 years ago

Last modified 3 years ago

Attempts to use curl cause warnings on some hosts

Reported by: Otto42 Owned by: anonymous
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

http-php.diff Download (452 bytes) - added by sivel 3 years ago.

Change History

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.

Hmmm...apparently I was too quick to jump for that resolution. just check for both curl_init and curl_exec.

sivel3 years ago

  • Status changed from new to closed
  • Resolution set to fixed

(In [10190]) Test for curl_exec as well to catch hosts that disable it but not curl_init. Fixes #8577 for trunk props sivel.

(In [10191]) Test for curl_exec as well to catch hosts that disable it but not curl_init. Fixes #8577 for 2.7 branch props sivel.

Note: See TracTickets for help on using tickets.