$this->parserTitle = Title::newFromText( 'Installer' );
$this->parserOptions = new ParserOptions( $wgUser ); // language will be wrong :(
+ $this->parserOptions->setTidy( true );
// Don't try to access DB before user language is initialised
$this->setParserLanguage( Language::factory( 'en' ) );
}
public function execute() {
$text = $this->getFileContents();
$text = InstallDocFormatter::format( $text );
- $this->parent->output->addWikiText( $text );
+ $this->parent->output->addWikiTextInterface( $text );
$this->startForm();
$this->endForm( false );
}
/**
* @param string $text
+ * @deprecated since 1.32; use addWikiTextInterface instead
*/
public function addWikiText( $text ) {
+ wfDeprecated( __METHOD__, '1.32' );
+ $this->addWikiTextInterface( $text );
+ }
+
+ /**
+ * @param string $text
+ */
+ public function addWikiTextInterface( $text ) {
$this->addHTML( $this->parent->parse( $text ) );
}
return 'continue';
}
}
- $this->parent->output->addWikiText( wfMessage( 'config-welcome' )->plain() );
+ $this->parent->output->addWikiTextInterface( wfMessage( 'config-welcome' )->plain() );
$status = $this->parent->doEnvironmentChecks();
if ( $status->isGood() ) {
$this->parent->output->addHTML( '<span class="success-message">' .
wfMessage( 'config-env-good' )->escaped() . '</span>' );
- $this->parent->output->addWikiText( wfMessage( 'config-copyright',
+ $this->parent->output->addWikiTextInterface( wfMessage( 'config-copyright',
SpecialVersion::getCopyrightAndAuthorList() )->plain() );
$this->startForm();
$this->endForm();
* @file
*/
+use Wikimedia\Timestamp\TimestampException;
+
class ImageHistoryPseudoPager extends ReverseChronologicalPager {
protected $preventClickjacking = false;
if ( !$this->mImg->exists() ) {
return;
}
+ // Make sure the date (probably from user input) is valid; if not, drop it.
+ if ( $this->mOffset !== null ) {
+ try {
+ $sadlyWeCannotPassThisTimestampDownTheStack = $this->mDb->timestamp( $this->mOffset );
+ } catch ( TimestampException $e ) {
+ $this->mOffset = null;
+ }
+ }
$queryLimit = $this->mLimit + 1; // limit plus extra row
if ( $this->mIsBackwards ) {
// Fetch the file history
*/
use MediaWiki\MediaWikiServices;
+use MediaWiki\Logger\LoggerFactory;
/**
* A special page that allows users to export pages in a XML file
$page = '';
$history = '';
} elseif ( $request->wasPosted() && $par == '' ) {
+ // Log to see if certain parameters are actually used.
+ // If not, we could deprecate them and do some cleanup, here and in WikiExporter.
+ LoggerFactory::getInstance( 'export' )->debug(
+ 'Special:Export POST, dir: [{dir}], offset: [{offset}], limit: [{limit}]', [
+ 'dir' => $request->getRawVal( 'dir' ),
+ 'offset' => $request->getRawVal( 'offset' ),
+ 'limit' => $request->getRawVal( 'limit' ),
+ ] );
+
$page = $request->getText( 'pages' );
$this->curonly = $request->getCheck( 'curonly' );
$rawOffset = $request->getVal( 'offset' );
} ).done( function ( data, jqXHR ) {
response( data[ 1 ], {
type: jqXHR.getResponseHeader( 'X-OpenSearch-Type' ),
+ searchId: jqXHR.getResponseHeader( 'X-Search-ID' ),
query: query
} );
} );
action: 'impression-results',
numberOfResults: context.config.suggestions.length,
resultSetType: metadata.type || 'unknown',
+ searchId: metadata.searchId || null,
query: metadata.query,
inputLocation: getInputLocation( context )
} );
// tracking purposes
promise.done( function ( data, jqXHR ) {
self.requestType = jqXHR.getResponseHeader( 'X-OpenSearch-Type' );
+ self.searchId = jqXHR.getResponseHeader( 'X-Search-ID' );
} );
return promise;
data: response || {},
metadata: {
type: this.requestType || 'unknown',
+ searchId: this.searchId || null,
query: this.getQueryValue()
}
};
this.requestType = undefined;
+ this.searchId = undefined;
return resp;
};
action: 'impression-results',
numberOfResults: items.length,
resultSetType: data.metadata.type,
+ searchId: data.metadata.searchId,
query: data.metadata.query,
inputLocation: this.dataLocation || 'header'
} );
const SCREEN_MEDIA_QUERY = 'screen and (min-width: 982px)';
const SCREEN_ONLY_MEDIA_QUERY = 'only screen and (min-width: 982px)';
+ // Ensure that we don't affect the global ResourceLoader state.
+ protected function setUp() {
+ parent::setUp();
+ ResourceLoader::clearCache();
+ }
+ protected function tearDown() {
+ parent::tearDown();
+ ResourceLoader::clearCache();
+ }
+
/**
* @dataProvider provideRedirect
*