Index: trunk/phase3/includes/Title.php |
— | — | @@ -4118,13 +4118,21 @@ |
4119 | 4119 | public function getRestrictionTypes() { |
4120 | 4120 | global $wgRestrictionTypes; |
4121 | 4121 | |
4122 | | - $types = $this->exists() ? $wgRestrictionTypes : array( 'create' ); |
| 4122 | + $types = $wgRestrictionTypes; |
4123 | 4123 | |
| 4124 | + if ( !$this->exists() ) { |
| 4125 | + # Only the create and upload types are applicable for non-existing titles |
| 4126 | + $types = array_intersect( $types, array( 'create', 'upload' ) ); |
| 4127 | + } |
4124 | 4128 | if ( $this->getNamespace() != NS_FILE ) { |
| 4129 | + # Remove the upload restriction for non-file titles |
4125 | 4130 | $types = array_diff( $types, array( 'upload' ) ); |
4126 | 4131 | } |
4127 | 4132 | |
4128 | 4133 | wfRunHooks( 'TitleGetRestrictionTypes', array( $this, &$types ) ); |
| 4134 | + |
| 4135 | + wfDebug( __METHOD__ . ': applicable restriction types for ' . |
| 4136 | + $this->getPrefixedText() . ' are ' . implode( ',', $types ) ); |
4129 | 4137 | |
4130 | 4138 | return $types; |
4131 | 4139 | } |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -3371,9 +3371,9 @@ |
3372 | 3372 | * You probably shouldn't change this. |
3373 | 3373 | * Translated through restriction-* messages. |
3374 | 3374 | * Title::getRestrictionTypes() will remove restrictions that are not |
3375 | | - * applicable to a specific title (upload currently) |
| 3375 | + * applicable to a specific title (create and upload) |
3376 | 3376 | */ |
3377 | | -$wgRestrictionTypes = array( 'edit', 'move', 'upload' ); |
| 3377 | +$wgRestrictionTypes = array( 'create', 'edit', 'move', 'upload' ); |
3378 | 3378 | |
3379 | 3379 | /** |
3380 | 3380 | * Rights which can be required for each protection level (via action=protect) |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -144,6 +144,8 @@ |
145 | 145 | * (bug 27560) Search queries no longer fail in walloon language |
146 | 146 | * (bug 27679) Broken embedded files with special characters longer double HTML |
147 | 147 | escaped |
| 148 | +* (bug 27700) The upload protection can now also be set for files that do not |
| 149 | + exist. |
148 | 150 | |
149 | 151 | |
150 | 152 | === API changes in 1.18 === |