r58537 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58536‎ | r58537 | r58538 >
Date:12:55, 4 November 2009
Author:btongminh
Status:ok
Tags:
Comment:
* (bug 6579) Fixed protecting images from uploading only
* Added upload by default to $wgRestrictionTypes

Also requires MessagesEn.php accidently committed in r58536
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/ProtectionForm.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)
  • /trunk/phase3/skins/common/protect.js (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -1751,7 +1751,7 @@
17521752 'protectexpiry',
17531753 'protect_expiry_invalid',
17541754 'protect_expiry_old',
1755 - 'protect-unchain',
 1755+ 'protect-unchain-permissions',
17561756 'protect-text',
17571757 'protect-locked-blocked',
17581758 'protect-locked-dblock',
Index: trunk/phase3/skins/common/protect.js
@@ -22,7 +22,7 @@
2323
2424 var boxbody = box.getElementsByTagName('tbody')[0]
2525 var row = document.createElement( 'tr' );
26 - boxbody.insertBefore( row, boxbody.firstChild );
 26+ boxbody.insertBefore( row, boxbody.firstChild.nextSibling );
2727
2828 this.existingMatch = opts.existingMatch;
2929
Index: trunk/phase3/includes/ProtectionForm.php
@@ -318,6 +318,10 @@
319319 Xml::openElement( 'tbody' );
320320
321321 foreach( $this->mRestrictions as $action => $selected ) {
 322+ // Special case: apply upload protection only on images
 323+ if ( $action == 'upload' && $this->mTitle->getNamespace() != NS_FILE )
 324+ continue;
 325+
322326 /* Not all languages have V_x <-> N_x relation */
323327 $msg = wfMsg( 'restriction-' . $action );
324328 if( wfEmptyMsg( 'restriction-' . $action, $msg ) ) {
@@ -547,8 +551,8 @@
548552 }
549553 $script .= "[" . implode(',',$CascadeableLevels) . "];\n";
550554 $options = (object)array(
551 - 'tableId' => 'mw-protect-table-move',
552 - 'labelText' => wfMsg( 'protect-unchain' ),
 555+ 'tableId' => 'mwProtectSet',
 556+ 'labelText' => wfMsg( 'protect-unchain-permissions' ),
553557 'numTypes' => count($this->mApplicableTypes),
554558 'existingMatch' => 1 == count( array_unique( $this->mExistingExpiry ) ),
555559 );
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1452,7 +1452,7 @@
14531453 * You probably shouldn't change this.
14541454 * Translated through restriction-* messages.
14551455 */
1456 -$wgRestrictionTypes = array( 'edit', 'move' );
 1456+$wgRestrictionTypes = array( 'edit', 'move', 'upload' );
14571457
14581458 /**
14591459 * Rights which can be required for each protection level (via action=protect)
Index: trunk/phase3/RELEASE-NOTES
@@ -96,6 +96,7 @@
9797 * $wgEnableHtmlDiff has been removed
9898 * (bug 3340) $wgBlockCIDRLimit added (default: 16) to configure the low end of
9999 CIDR ranges for blocking
 100+* Added upload by default to $wgRestrictionTypes
100101
101102 === New features in 1.16 ===
102103
@@ -617,6 +618,7 @@
618619 * (bug 19859) Removed experimental HTMLDiff feature
619620 * Removed section edit links in edit conflict form
620621 * Allow SpecialActiveusers to work on non-MySQL databases
 622+* (bug 6579) Fixed protecting images from uploading only
621623
622624 == API changes in 1.16 ==
623625

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r58536* Disable autofill for reuploads...btongminh12:53, 4 November 2009

Status & tagging log