Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -418,12 +418,12 @@ |
419 | 419 | } |
420 | 420 | } |
421 | 421 | } |
| 422 | + |
| 423 | + // If they used redlink=1 and the page exists, redirect to the main article |
| 424 | + if ( $wgRequest->getBool( 'redlink' ) && $this->mTitle->exists() ) { |
| 425 | + $wgOut->redirect( $this->mTitle->getFullURL() ); |
| 426 | + } |
422 | 427 | |
423 | | - # Evaluate if the edit interface should be shown or |
424 | | - # if the page should be shown, in case redlink=true |
425 | | - if ( $wgRequest->getBool( 'redlink' ) ) |
426 | | - $this->showPageOnRedlink(); |
427 | | - |
428 | 428 | wfProfileIn( __METHOD__."-business-end" ); |
429 | 429 | |
430 | 430 | $this->isConflict = false; |
— | — | @@ -487,45 +487,7 @@ |
488 | 488 | wfProfileOut( __METHOD__."-business-end" ); |
489 | 489 | wfProfileOut( __METHOD__ ); |
490 | 490 | } |
491 | | - |
492 | | - /* |
493 | | - * Evaluate if the edit interface should be shown or the page, in case redlink=true. |
494 | | - * If the page exists, it is always shown. If it doesn't, it depends on the settings |
495 | | - * of $wgShowPageOnRedlink (see DefaultSettings for documentation). |
496 | | - */ |
497 | | - protected function showPageOnRedlink() { |
498 | | - global $wgShowPageOnRedlink, $wgUser, $wgRequest, $wgOut; |
499 | | - $redirectToPage = false; |
500 | | - # If the page exists (it has been created after the link has been emerged), |
501 | | - # redirect to the page instead of editing the current page |
502 | | - if ( $this->mTitle->exists() ) |
503 | | - $wgOut->redirect( $this->mTitle->getFullURL() ); |
504 | | - # Check site configuration ($wgShowPageOnRedlink) |
505 | | - if ( is_array( $wgShowPageOnRedlink ) ) { |
506 | | - $ns = $this->mTitle->getNamespace(); |
507 | | - $groups = $wgUser->getEffectiveGroups(); |
508 | | - # Gets overwritten if user is member of a group that has been specified: |
509 | | - $redirectToPage = true; |
510 | | - foreach ( $groups as $i => $group ) { |
511 | | - # Test if there is a rule for a specific usergroup and a specific namespace |
512 | | - if ( isset( $wgShowPageOnRedlink[$group][$ns] ) && $wgShowPageOnRedlink[$group][$ns] == false ) { |
513 | | - $redirectToPage = false; |
514 | | - } |
515 | | - # Test if there is a rule for a specific usergroup in all namespaces |
516 | | - elseif ( isset( $wgShowPageOnRedlink[$group] ) && !is_array( $wgShowPageOnRedlink[$group] ) |
517 | | - && $wgShowPageOnRedlink[$group] == false ) { |
518 | | - $redirectToPage = false; |
519 | | - } |
520 | | - } |
521 | | - } |
522 | | - else { |
523 | | - $redirectToPage = $wgShowPageOnRedlink; |
524 | | - } |
525 | | - if ( $redirectToPage ) { |
526 | | - $wgOut->redirect( $this->mTitle->getFullURL() ); |
527 | | - } |
528 | | - } |
529 | | - |
| 491 | + |
530 | 492 | protected function getEditPermissionErrors() { |
531 | 493 | global $wgUser; |
532 | 494 | $permErrors = $this->mTitle->getUserPermissionsErrors( 'edit', $wgUser ); |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -4275,16 +4275,3 @@ |
4276 | 4276 | * Use old names for change_tags indices. |
4277 | 4277 | */ |
4278 | 4278 | $wgOldChangeTagsIndex = false; |
4279 | | - |
4280 | | -/** |
4281 | | - * View page instead of edit interface when visiting a red link |
4282 | | - * There are three ways to define this variable: |
4283 | | - * 1. Set $wgShowPageOnRedlink to true (false is default) |
4284 | | - * 2. Set $wgShowPageOnRedlink['usergroup'] to false. If a user is member of at least one usergroup for which the variable |
4285 | | - * has been set to false, the edit interface will be shown. Otherwise the page is shown. |
4286 | | - * 3. Set $wgShowPageOnRedlink['usergroup'][NS_XY] to false. Same as 2., but you can specify the namespace. The namespace |
4287 | | - * is a numerical value (namespace index), you can use constants such as NS_MAIN or NS_USER_TALK. |
4288 | | - * If you use an array (2. or 3.), the default will be true (for 1. it's false). In 2. and 3. there is no way to overwrite |
4289 | | - * a value 'false' once it has already been set (this is due to the undefined order of usergroups). |
4290 | | - */ |
4291 | | -$wgShowPageOnRedlink = false; |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -232,9 +232,6 @@ |
233 | 233 | $wgAJAXCategoriesNamespaces. |
234 | 234 | * Admins could disable some variants using $wgDisabledVariants now. ONLY apply |
235 | 235 | on wikis enabled LanguageConverter. |
236 | | -* New configuration variable $wgShowPageOnRedlink that can be set to show the |
237 | | - page instead of an edit interface when visiting a red link. The value can be |
238 | | - specified for specific usergroups and namespaces. |
239 | 236 | * (bug 16310) Credits page now lists IP addresses rather than saying the number |
240 | 237 | of anonymous users that edited the page |
241 | 238 | * New permission 'sendemail' added. Default right for all registered users. Can |