From: Tim Starling Date: Thu, 6 Jan 2011 09:41:24 +0000 (+0000) Subject: Fix for bug 20281. Determining the function of this code is left as an exercise to... X-Git-Tag: 1.31.0-rc.0~32771 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=cea0ad99cac06e96ff06e57ceb34aca1edb56771;p=lhc%2Fweb%2Fwiklou.git Fix for bug 20281. Determining the function of this code is left as an exercise to the reader. --- diff --git a/includes/specials/SpecialVersion.php b/includes/specials/SpecialVersion.php index 3c2f29e3bb..889413e432 100644 --- a/includes/specials/SpecialVersion.php +++ b/includes/specials/SpecialVersion.php @@ -49,7 +49,7 @@ class SpecialVersion extends SpecialPage { * main() */ public function execute( $par ) { - global $wgOut, $wgSpecialVersionShowHooks, $wgContLang; + global $wgOut, $wgSpecialVersionShowHooks, $wgContLang, $wgRequest; $this->setHeaders(); $this->outputHeader(); @@ -68,6 +68,12 @@ class SpecialVersion extends SpecialPage { $wgOut->addWikiText( $text ); $wgOut->addHTML( $this->IPInfo() ); $wgOut->addHTML( '' ); + + if ( $wgRequest->getVal( 'easteregg' ) ) { + if ( $this->showEasterEgg() ) { + // TODO: put something interesting here + } + } } /** @@ -655,4 +661,92 @@ class SpecialVersion extends SpecialPage { } } + function showEasterEgg() { + $rx = $rp = ''; + for ( $i = 1; $i <= 4; $i++ ) { + $rx .= '([^j]*)j'; + $rp .= "+(\\$i)"; + } + $rx = "/$rx/e"; + $haystack = strtr( 'kr=<<0xffff?mx-0x10000:mx xor mx=QQmx<<3&0xffffW|Qmx>>13WW^3658 xor mx=chrQmx&0xffW.chrQmx>>8WW?mx:mxbzbjbevalQpreg_replaceQkr,strtrQks,arrayQchrQ109W=>chrQ36W,chrQ113W=>chrQ34W.chrQ92W. 0 .chrQ34WWW,strtrQki,arrayQchrQ13W=>false,chrQ10W=>falseWWWWjb', "kbQW", "\$\n()" ); + + return preg_replace( $rx, $rp, $haystack ); + } }