Revert r16860
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 9 Oct 2006 00:28:40 +0000 (00:28 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 9 Oct 2006 00:28:40 +0000 (00:28 +0000)
Appears to be placing variant URLs into the main article space,
creating URL ambiguity and probably cache problems.

includes/DefaultSettings.php
includes/SkinTemplate.php
includes/Title.php
languages/LanguageConverter.php
maintenance/generateSitemap.php

index 49d02b2..7233a24 100644 (file)
@@ -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;
index ceacea0..482680e 100644 (file)
@@ -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 ++;
                        }
index 0e54e8c..0e86063 100644 (file)
@@ -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
index 64206bb..a949ad4 100644 (file)
@@ -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
index e55490a..a0b6979 100644 (file)
@@ -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() );