Remove various references to cURL in code comments
authorTimo Tijhof <krinklemail@gmail.com>
Tue, 5 Mar 2019 23:55:03 +0000 (23:55 +0000)
committerTimo Tijhof <krinklemail@gmail.com>
Tue, 5 Mar 2019 23:55:03 +0000 (23:55 +0000)
Given we now use Guzzle as well, and don't require cURL for any
features at a basic level, our code should not be as assumptious
about the backend being curl. Such assumptions may be wrong
and lead to confusion and/or bugs.

Bug: T137926
Change-Id: I6ad7f76768348e1eb8c1fb46c8125cce9285dc22

includes/clientpool/SquidPurgeClient.php
includes/http/Http.php
includes/specials/SpecialUploadStash.php

index 005b326..49d9d1c 100644 (file)
@@ -25,7 +25,7 @@
  * Uses asynchronous I/O, allowing purges to be done in a highly parallel
  * manner.
  *
- * Could be replaced by curl_multi_exec() or some such.
+ * @todo Consider using MultiHttpClient.
  */
 class SquidPurgeClient {
        /** @var string */
index c29f199..f0972dc 100644 (file)
@@ -132,11 +132,14 @@ class Http {
        }
 
        /**
-        * Checks that the given URI is a valid one. Hardcoding the
-        * protocols, because we only want protocols that both cURL
-        * and php support.
+        * Check that the given URI is a valid one.
         *
-        * file:// should not be allowed here for security purpose (r67684)
+        * This hardcodes a small set of protocols only, because we want to
+        * deterministically reject protocols not supported by all HTTP-transport
+        * methods.
+        *
+        * "file://" specifically must not be allowed, for security purpose
+        * (see <https://www.mediawiki.org/wiki/Special:Code/MediaWiki/r67684>).
         *
         * @todo FIXME this is wildly inaccurate and fails to actually check most stuff
         *
index abd3e07..4d0c20c 100644 (file)
@@ -261,7 +261,8 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                $scalerThumbUrl = $scalerBaseUrl . '/' . $file->getUrlRel() .
                        '/' . rawurlencode( $scalerThumbName );
 
-               // make a curl call to the scaler to create a thumbnail
+               // make an http request based on wgUploadStashScalerBaseUrl to lazy-create
+               // a thumbnail
                $httpOptions = [
                        'method' => 'GET',
                        'timeout' => 5 // T90599 attempt to time out cleanly