Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#8577 closed defect (bug) (fixed)

Attempts to use curl cause warnings on some hosts

Reported by: otto42's profile Otto42 Owned by:
Milestone: 2.7.1 Priority: normal
Severity: normal Version: 2.7
Component: General Keywords:
Focuses: 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)

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

Download all attachments as: .zip

Change History (6)

#2 @sivel
15 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.

#3 @sivel
15 years ago

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

@sivel
15 years ago

#4 @westi
15 years ago

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

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

#5 @westi
15 years ago

(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.