http://www.mediawiki.org/wiki/Special:Code/MediaWiki/89812
Revision: 89812
Author: demon
Date: 2011-06-10 02:56:11 +0000 (Fri, 10 Jun 2011)
Log Message:
-----------
MFT r89278, r89452. Also had to grab r83360.
Modified Paths:
--------------
branches/REL1_17/phase3/includes/HttpFunctions.php
Property Changed:
----------------
branches/REL1_17/phase3/includes/HttpFunctions.php
Modified: branches/REL1_17/phase3/includes/HttpFunctions.php
===================================================================
--- branches/REL1_17/phase3/includes/HttpFunctions.php 2011-06-10 02:17:46 UTC
(rev 89811)
+++ branches/REL1_17/phase3/includes/HttpFunctions.php 2011-06-10 02:56:11 UTC
(rev 89812)
@@ -116,16 +116,19 @@
}
/**
- * Checks that the given URI is a valid one
+ * Checks that the given URI is a valid one. Hardcoding the
+ * protocols, because we only want protocols that both cURL
+ * and php support.
*
+ * @fixme this is wildly inaccurate and fails to actually check most
stuff
+ *
* @param $uri Mixed: URI to check for validity
* @returns Boolean
*/
public static function isValidURI( $uri ) {
return preg_match(
-
'/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/',
- $uri,
- $matches
+ '/^https?:\/\/[^\/\s]\S*$/D',
+ $uri
);
}
}
@@ -939,7 +942,8 @@
// causes a segfault
$manuallyRedirect = version_compare( phpversion(), '5.1.7', '<'
);
- if ( $this->parsedUrl['scheme'] != 'http' ) {
+ if ( $this->parsedUrl['scheme'] != 'http' &&
+ $this->parsedUrl['scheme'] != 'https' ) {
$this->status->fatal( 'http-invalid-scheme',
$this->parsedUrl['scheme'] );
}
Property changes on: branches/REL1_17/phase3/includes/HttpFunctions.php
___________________________________________________________________
Added: svn:mergeinfo
+ /branches/REL1_15/phase3/includes/HttpFunctions.php:51646
/branches/new-installer/phase3/includes/HttpFunctions.php:43664-66004
/branches/sqlite/includes/HttpFunctions.php:58211-58321
/branches/wmf-deployment/includes/HttpFunctions.php:53381
/trunk/phase3/includes/HttpFunctions.php:82474,82845,82847-82848,83360,85752,89278,89452
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs