* (bug 27560) Search queries no longer fail in walloon language
* (bug 27679) Broken embedded files with special characters longer double HTML
escaped
+* (bug 27700) The upload protection can now also be set for files that do not
+ exist.
=== API changes in 1.18 ===
* 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)
+ * applicable to a specific title (create and upload)
*/
-$wgRestrictionTypes = array( 'edit', 'move', 'upload' );
+$wgRestrictionTypes = array( 'create', 'edit', 'move', 'upload' );
/**
* Rights which can be required for each protection level (via action=protect)
public function getRestrictionTypes() {
global $wgRestrictionTypes;
- $types = $this->exists() ? $wgRestrictionTypes : array( 'create' );
+ $types = $wgRestrictionTypes;
+ if ( !$this->exists() ) {
+ # Only the create and upload types are applicable for non-existing titles
+ $types = array_intersect( $types, array( 'create', 'upload' ) );
+ }
if ( $this->getNamespace() != NS_FILE ) {
+ # Remove the upload restriction for non-file titles
$types = array_diff( $types, array( 'upload' ) );
}
wfRunHooks( 'TitleGetRestrictionTypes', array( $this, &$types ) );
+
+ wfDebug( __METHOD__ . ': applicable restriction types for ' .
+ $this->getPrefixedText() . ' are ' . implode( ',', $types ) );
return $types;
}