From: Brion Vibber Date: Mon, 9 Oct 2006 00:28:40 +0000 (+0000) Subject: Revert r16860 X-Git-Tag: 1.31.0-rc.0~55569 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=bcf5bfb35fe73466003baa82f5da7165a50234c6;p=lhc%2Fweb%2Fwiklou.git Revert r16860 Appears to be placing variant URLs into the main article space, creating URL ambiguity and probably cache problems. --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 49d02b2bc6..7233a24b76 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -124,7 +124,6 @@ $wgStylePath = "{$wgScriptPath}/skins"; $wgStyleDirectory = "{$IP}/skins"; $wgStyleSheetPath = &$wgStylePath; $wgArticlePath = "{$wgScript}?title=$1"; -$wgVariantArticlePath = false; $wgUploadPath = "{$wgScriptPath}/images"; $wgUploadDirectory = "{$IP}/images"; $wgHashedUploadDirectory = true; diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index ceacea0114..482680e632 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -765,7 +765,7 @@ class SkinTemplate extends Skin { $content_actions['varlang-' . $vcount] = array( 'class' => $selected, 'text' => $varname, - 'href' => $this->mTitle->getLocalVariantURL($code) + 'href' => $this->mTitle->getLocalUrl( $actstr . 'variant=' . urlencode( $code ) ) ); $vcount ++; } diff --git a/includes/Title.php b/includes/Title.php index 0e54e8cb8b..0e86063ee4 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -811,35 +811,6 @@ class Title { return $url; } - /** - * Get a real URL referring to this title in some of the variant - * - * @param string $variant variant name - * @return string the URL - * @access public - */ - function getFullVariantURL( $variant = '' ) { - global $wgServer, $wgRequest; - - $url=''; // this function should not be called for interwiki - - if ( '' == $this->mInterwiki ) { - $url = $this->getLocalVariantURL( $variant ); - - if ($wgRequest->getVal('action') != 'render') { - $url = $wgServer . $url; - } - } - - # Finally, add the fragment. - if ( '' != $this->mFragment ) { - $url .= '#' . $this->mFragment; - } - - return $url; - } - - /** * Get a URL with no fragment or server name. If this page is generated * with action=render, $wgServer is prepended. @@ -896,30 +867,6 @@ class Title { return $url; } - /** - * Similar to getLocalURL, except it uses $wgVariantArticlePath - * and gets the URL with no fragment or server name, but in a - * certain language variant (relevant only to languages with variants) - * @param string $variant caption of variant - * @return string the URL - * @access public - */ - function getLocalVariantURL( $variant='' ) { - global $wgVariantArticlePath,$wgScript; - if($variant=='') return $this->getLocalURL(); - - if($wgVariantArticlePath==false) - $wgVariantArticlePath = "$wgScript?title=$1&variant=$2"; - - $dbkey = wfUrlencode( $this->getPrefixedDBkey() ); - $url = str_replace( '$1', $dbkey, $wgVariantArticlePath ); - $code = urlencode( $variant ); - $url = str_replace( '$2', $code, $url ); - - return $url; - - } - /** * Get an HTML-escaped version of the URL form, suitable for * using in a link, without a server name or fragment diff --git a/languages/LanguageConverter.php b/languages/LanguageConverter.php index 64206bb1a6..a949ad4e0b 100644 --- a/languages/LanguageConverter.php +++ b/languages/LanguageConverter.php @@ -96,14 +96,6 @@ class LanguageConverter { return $req; } - // check the syntax /code/ArticleTitle - $script = $_SERVER['SCRIPT_NAME']; - $variants = implode('|',$this->mVariants); - if(preg_match("/($variants)$/",$script,$matches)){ - $this->mPreferredVariant = $matches[1]; - return $this->mPreferredVariant; - } - // get language variant preference from logged in users // Don't call this on stub objects because that causes infinite // recursion during initialisation diff --git a/maintenance/generateSitemap.php b/maintenance/generateSitemap.php index e55490a587..a0b6979d0d 100644 --- a/maintenance/generateSitemap.php +++ b/maintenance/generateSitemap.php @@ -264,16 +264,6 @@ class GenerateSitemap { $entry = $this->fileEntry( $title->getFullURL(), $date, $this->priority( $namespace ) ); $length += strlen( $entry ); $this->write( $this->file, $entry ); - // generate pages for language variants - if($wgContLang->hasVariants()){ - $variants = $wgContLang->getVariants(); - foreach($variants as $vCode){ - if($vCode==$wgContLang->getCode()) continue; // we don't want default variant - $entry = $this->fileEntry( $title->getFullVariantURL($vCode), $date, $this->priority( $namespace ) ); - $length += strlen( $entry ); - $this->write( $this->file, $entry ); - } - } } if ( $this->file ) { $this->write( $this->file, $this->closeFile() );