From: Brion Vibber Date: Tue, 27 Mar 2007 21:43:21 +0000 (+0000) Subject: Revert r20426 which added an unused $isvalid parameter on Title::newFromURL() X-Git-Tag: 1.31.0-rc.0~53574 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22calendrier%22%2C%22type=semaine%22%29%20.%20%22?a=commitdiff_plain;h=c1b3e84d5d6de26df874316ec9242eedcf51e1c9;p=lhc%2Fweb%2Fwiklou.git Revert r20426 which added an unused $isvalid parameter on Title::newFromURL() It gives me the willies... --- diff --git a/includes/Title.php b/includes/Title.php index 02b5b8c606..070cd2422f 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -161,12 +161,11 @@ class Title { * Create a new Title from URL-encoded text. Ensures that * the given title's length does not exceed the maximum. * @param string $url the title, as might be taken from a URL - * @param bool $isvalid, allows for multiple colons and characters set as illegal * @return Title the new object, or NULL on an error * @static * @access public */ - public static function newFromURL( $url, $isvalid=true ) { + public static function newFromURL( $url ) { global $wgLegalTitleChars; $t = new Title(); @@ -178,7 +177,7 @@ class Title { } $t->mDbkeyform = str_replace( ' ', '_', $url ); - if( $t->secureAndSplit( $isvalid ) ) { + if( $t->secureAndSplit() ) { return $t; } else { return NULL; @@ -1706,11 +1705,10 @@ class Title { * removes illegal characters, splits off the interwiki and * namespace prefixes, sets the other forms, and canonicalizes * everything. - * @param bool $isvalid, allows for multiple colons and characters set as illegal * @return bool true on success * @private */ - /* private */ function secureAndSplit( $isvalid=true ) { + /* private */ function secureAndSplit() { global $wgContLang, $wgLocalInterwiki, $wgCapitalLinks; # Initialisation @@ -1811,7 +1809,7 @@ class Title { $this->mArticleID = 0; } $fragment = strstr( $dbkey, '#' ); - if ( $isvalid && false !== $fragment ) { + if ( false !== $fragment ) { $this->setFragment( $fragment ); $dbkey = substr( $dbkey, 0, strlen( $dbkey ) - strlen( $fragment ) ); # remove whitespace again: prevents "Foo_bar_#" @@ -1821,7 +1819,7 @@ class Title { # Reject illegal characters. # - if( $isvalid && preg_match( $rxTc, $dbkey ) ) { + if( preg_match( $rxTc, $dbkey ) ) { return false; }