Index: trunk/phase3/includes/ProtectionForm.php |
— | — | @@ -185,6 +185,16 @@ |
186 | 186 | |
187 | 187 | } |
188 | 188 | |
| 189 | + # They shouldn't be able to do this anyway, but just to make sure, ensure that cascading restrictions aren't being applied |
| 190 | + # to a semi-protected page. |
| 191 | + global $wgGroupPermissions; |
| 192 | + |
| 193 | + $edit_restriction = $this->mRestrictions['edit']; |
| 194 | + |
| 195 | + if ($this->mCascade && ($edit_restriction != 'protect') && |
| 196 | + !(isset($wgGroupPermissions[$edit_restriction]['protect']) && $wgGroupPermissions[$edit_restriction]['protect'] ) ) |
| 197 | + $this->mCascade = false; |
| 198 | + |
189 | 199 | $ok = $this->mArticle->updateRestrictions( $this->mRestrictions, $this->mReason, $this->mCascade, $expiry ); |
190 | 200 | if( !$ok ) { |
191 | 201 | throw new FatalError( "Unknown error at restriction save time." ); |
— | — | @@ -359,7 +369,7 @@ |
360 | 370 | $script = 'var wgCascadeableLevels='; |
361 | 371 | $CascadeableLevels = array(); |
362 | 372 | foreach( $wgRestrictionLevels as $key ) { |
363 | | - if ( isset($wgGroupPermissions[$key]['protect']) && $wgGroupPermissions[$key]['protect'] ) { |
| 373 | + if ( (isset($wgGroupPermissions[$key]['protect']) && $wgGroupPermissions[$key]['protect']) || $key == 'protect' ) { |
364 | 374 | $CascadeableLevels[]="'" . wfEscapeJsString($key) . "'"; |
365 | 375 | } |
366 | 376 | } |