X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhttp%2FPhpHttpRequest.php;h=c987c62b1cc595be7d6902fff0c19dc92d2c3538;hb=fbba262dc3b0627fb10b08d1c46f31d1599dfc91;hp=d2af8c8568c1c3889bbf3be3db31c38b600f343f;hpb=3f815798a15af8ca73198b9b5d7af1b29e703a41;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/http/PhpHttpRequest.php b/includes/http/PhpHttpRequest.php index d2af8c8568..c987c62b1c 100644 --- a/includes/http/PhpHttpRequest.php +++ b/includes/http/PhpHttpRequest.php @@ -22,6 +22,17 @@ class PhpHttpRequest extends MWHttpRequest { private $fopenErrors = []; + public function __construct() { + if ( !wfIniGetBool( 'allow_url_fopen' ) ) { + throw new RuntimeException( __METHOD__ . ': allow_url_fopen needs to be enabled for ' . + 'pure PHP http requests to work. If possible, curl should be used instead. See ' . + 'https://www.php.net/curl.' + ); + } + + parent::__construct( ...func_get_args() ); + } + /** * @param string $url * @return string