Index: branches/REL1_17/phase3/includes/HttpFunctions.php |
— | — | @@ -116,16 +116,19 @@ |
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
120 | | - * Checks that the given URI is a valid one |
| 120 | + * Checks that the given URI is a valid one. Hardcoding the |
| 121 | + * protocols, because we only want protocols that both cURL |
| 122 | + * and php support. |
121 | 123 | * |
| 124 | + * @fixme this is wildly inaccurate and fails to actually check most stuff |
| 125 | + * |
122 | 126 | * @param $uri Mixed: URI to check for validity |
123 | 127 | * @returns Boolean |
124 | 128 | */ |
125 | 129 | public static function isValidURI( $uri ) { |
126 | 130 | return preg_match( |
127 | | - '/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/', |
128 | | - $uri, |
129 | | - $matches |
| 131 | + '/^https?:\/\/[^\/\s]\S*$/D', |
| 132 | + $uri |
130 | 133 | ); |
131 | 134 | } |
132 | 135 | } |
— | — | @@ -939,7 +942,8 @@ |
940 | 943 | // causes a segfault |
941 | 944 | $manuallyRedirect = version_compare( phpversion(), '5.1.7', '<' ); |
942 | 945 | |
943 | | - if ( $this->parsedUrl['scheme'] != 'http' ) { |
| 946 | + if ( $this->parsedUrl['scheme'] != 'http' && |
| 947 | + $this->parsedUrl['scheme'] != 'https' ) { |
944 | 948 | $this->status->fatal( 'http-invalid-scheme', $this->parsedUrl['scheme'] ); |
945 | 949 | } |
946 | 950 | |
Property changes on: branches/REL1_17/phase3/includes/HttpFunctions.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
947 | 951 | Merged /branches/new-installer/phase3/includes/HttpFunctions.php:r43664-66004 |
948 | 952 | Merged /branches/wmf-deployment/includes/HttpFunctions.php:r53381 |
949 | 953 | Merged /branches/REL1_15/phase3/includes/HttpFunctions.php:r51646 |
950 | 954 | Merged /branches/sqlite/includes/HttpFunctions.php:r58211-58321 |
951 | 955 | Merged /trunk/phase3/includes/HttpFunctions.php:r82474,82845,82847-82848,83360,85752,89278,89452 |