/** * Main execution function * * @param $par Mixed: Parameters passed to the page */ public function execute( $par ) { global $wgOut; $title = ShortUrlUtils::decodeURL( $par ); if ( $title !== false ) { $wgOut->redirect( $title->getFullURL(), '301' ); } else { $wgOut->showErrorPage( 'shorturl-not-found-title', 'shorturl-not-found-message', array( $par ) ); } }
/** * Main execution function * * @param $par Mixed: Parameters passed to the page */ public function execute($par) { $out = $this->getOutput(); $title = ShortUrlUtils::decodeURL($par); if ($title !== false) { $out->redirect($title->getFullURL(), '301'); } else { $parEsc = wfEscapeWikiText($par); $out->showErrorPage('shorturl-not-found-title', 'shorturl-not-found-message', array($parEsc)); } }