From cea0ad99cac06e96ff06e57ceb34aca1edb56771 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 6 Jan 2011 09:41:24 +0000 Subject: [PATCH] Fix for bug 20281. Determining the function of this code is left as an exercise to the reader. --- includes/specials/SpecialVersion.php | 96 +++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 1 deletion(-) 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 ); + } } -- 2.20.1