r16966 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r16965‎ | r16966 | r16967 >
Date:10:20, 12 October 2006
Author:rainman
Status:old
Tags:
Comment:

Using basename() for parsing /sr-ec/Title syntax
Modified paths:
  • /branches/SerbianVariants/phase3/languages/LanguageConverter.php (modified) (history)

Diff [purge]

Index: branches/SerbianVariants/phase3/languages/LanguageConverter.php
@@ -98,10 +98,9 @@
9999 }
100100
101101 // check the syntax /code/ArticleTitle
102 - $script = $_SERVER['SCRIPT_NAME'];
103 - $variants = implode('|',$this->mVariants);
104 - if(preg_match("/($variants)$/",$script,$matches)){
105 - $this->mPreferredVariant = $matches[1];
 102+ $scriptBase = basename( $_SERVER['SCRIPT_NAME'] );
 103+ if(in_array($scriptBase,$this->mVariants)){
 104+ $this->mPreferredVariant = $scriptBase;
106105 return $this->mPreferredVariant;
107106 }
108107