link has a % sign in it.
* (bug 26412) Search results headers no longer show a bogus edit link.
* (bug 26540) Fixed wrong call to applyPatch in MysqlUpdater
+* (bug 26574) Added 'upload' to $wgRestrictionTypes, allowing upload protected
+ pages to be queried via the API and Special:ProtectedPages, and allowing
+ disabling upload protection by removing it from $wgRestrictionTypes.
=== API changes in 1.18 ===
* (bug 26339) Throw warning when truncating an overlarge API result
* Set of available actions that can be restricted via action=protect
* You probably shouldn't change this.
* Translated through restriction-* messages.
+ * Title::getRestrictionTypes() will remove restrictions that are not
+ * applicable to a specific title (upload currently)
*/
-$wgRestrictionTypes = array( 'edit', 'move' );
+$wgRestrictionTypes = array( 'edit', 'move', 'upload' );
/**
* Rights which can be required for each protection level (via action=protect)
'wgCategories' => $wgOut->getCategories(),
'wgBreakFrames' => $wgOut->getFrameOptions() == 'DENY',
);
- foreach ( $wgRestrictionTypes as $type ) {
+ foreach ( $wgTitle->getRestrictionTypes() as $type ) {
$vars['wgRestriction' . ucfirst( $type )] = $wgTitle->getRestrictions( $type );
}
if ( $wgUseAjax && $wgEnableMWSuggest && !$wgUser->getOption( 'disablesuggest', false ) ) {
*/
public function getRestrictionTypes() {
global $wgRestrictionTypes;
+
$types = $this->exists() ? $wgRestrictionTypes : array( 'create' );
- if ( $this->getNamespace() == NS_FILE ) {
- $types[] = 'upload';
+ if ( $this->getNamespace() != NS_FILE && in_array( 'upload', $types ) ) {
+ $types = array_diff( $types, array( 'upload' ) );
}
-
+
wfRunHooks( 'TitleGetRestrictionTypes', array( $this, &$types ) );
-
+
return $types;
}