Merge "Deprecate setting $wgAllowImageMoving to false"
This commit is contained in:
commit
eafe225ed8
4 changed files with 15 additions and 0 deletions
|
|
@ -118,6 +118,9 @@ For notes on 1.34.x and older releases, see HISTORY.
|
|||
Configure the ParserFactory service in order to customize the Parser used.
|
||||
* $wgAutoloadAttemptLowercase has been deprecated and the default value changed
|
||||
to false.
|
||||
* $wgAllowImageMoving - This configuration is now deprecated. Use
|
||||
$wgGroupPermissions instead; eg, to revoke sysop's ability to move images use
|
||||
$wgGroupPermissions['sysop']['movefile'] = false.
|
||||
* …
|
||||
|
||||
==== Removed configuration ====
|
||||
|
|
|
|||
|
|
@ -448,6 +448,10 @@ $wgUploadStashMaxAge = 6 * 3600; // 6 hours
|
|||
|
||||
/**
|
||||
* Allows to move images and other media files
|
||||
*
|
||||
* @deprecated since 1.35, use group permission settings instead.
|
||||
* (eg $wgGroupPermissions['sysop']['movefile'] = false; to revoke the
|
||||
* ability from sysops)
|
||||
*/
|
||||
$wgAllowImageMoving = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -154,6 +154,10 @@ class NamespaceInfo {
|
|||
* @return bool
|
||||
*/
|
||||
public function isMovable( $index ) {
|
||||
if ( !$this->options->get( 'AllowImageMoving' ) ) {
|
||||
wfDeprecated( 'Setting $wgAllowImageMoving to false', '1.35' );
|
||||
}
|
||||
|
||||
$result = $index >= NS_MAIN &&
|
||||
( $index != NS_FILE || $this->options->get( 'AllowImageMoving' ) );
|
||||
|
||||
|
|
|
|||
|
|
@ -122,6 +122,10 @@ class NamespaceInfoTest extends MediaWikiTestCase {
|
|||
* @param bool $allowImageMoving
|
||||
*/
|
||||
public function testIsMovable( $expected, $ns, $allowImageMoving = true ) {
|
||||
if ( $allowImageMoving === false ) {
|
||||
$this->hideDeprecated( 'Setting $wgAllowImageMoving to false' );
|
||||
}
|
||||
|
||||
$obj = $this->newObj( [ 'AllowImageMoving' => $allowImageMoving ] );
|
||||
$this->assertSame( $expected, $obj->isMovable( $ns ) );
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue