Use MediaWiki\Session\SessionManager instead.
* The wfGetLBFactory global function, deprecated in 1.27, has been removed.
Use MediaWikiServices::getInstance()->getDBLoadBalancerFactory().
+* The internal method OutputPage->addScriptFile() will no longer silently drop
+ calls that use an invalid path (i.e., something other than an absolute path,
+ protocol-relative URL, or full scheme URL), and will instead pass them to the
+ client where they will likely 404. This usage was deprecated in 1.24.
* …
=== Deprecations in 1.34 ===
* @param string|null $unused Previously used to change the cache-busting query parameter
*/
public function addScriptFile( $file, $unused = null ) {
- if ( substr( $file, 0, 1 ) !== '/' && !preg_match( '#^[a-z]*://#i', $file ) ) {
- // This is not an absolute path, protocol-relative url, or full scheme url,
- // presumed to be an old call intended to include a file from /w/skins/common,
- // which doesn't exist anymore as of MediaWiki 1.24 per T71277. Ignore.
- wfDeprecated( __METHOD__, '1.24' );
- return;
- }
$this->addScript( Html::linkedScript( $file, $this->getCSPNonce() ) );
}
);
}
- /**
- * Test that addScriptFile() throws due to deprecation.
- *
- * @covers OutputPage::addScriptFile
- */
- public function testAddDeprecatedScriptFileWarning() {
- $this->setExpectedException( PHPUnit_Framework_Error_Deprecated::class,
- 'Use of OutputPage::addScriptFile was deprecated in MediaWiki 1.24.' );
-
- $op = $this->newInstance();
- $op->addScriptFile( 'ignored-script.js' );
- }
-
- /**
- * Test the actual behavior of the method (in the case where it doesn't throw, e.g., in
- * production).
- *
- * @covers OutputPage::addScriptFile
- */
- public function testAddDeprecatedScriptFileNoOp() {
- $this->hideDeprecated( 'OutputPage::addScriptFile' );
- $op = $this->newInstance();
- $op->addScriptFile( 'ignored-script.js' );
-
- $this->assertNotContains( 'ignored-script.js', '' . $op->getBottomScripts() );
- }
-
/**
* @covers OutputPage::addInlineScript
*/