(bug 37755) Set robot meta tags for 'view source' pages
authorOren Held <oren@held.org.il>
Sat, 13 Oct 2012 10:40:55 +0000 (12:40 +0200)
committerOren Held <oren@held.org.il>
Sun, 2 Dec 2012 07:36:32 +0000 (09:36 +0200)
Apply the same robot behavior of the edit & history pages (noindex,nofollow), on view source pages
(case of ?action=edit when having no edit permissios).

Change-Id: Ifc162332798a3dea93db4096d26e928545fbf4b6

includes/EditPage.php

index cc41b02..0e92754 100644 (file)
@@ -477,6 +477,7 @@ class EditPage {
                        throw new PermissionsError( $action, $permErrors );
                }
 
+               $wgOut->setRobotPolicy( 'noindex,nofollow' );
                $wgOut->setPageTitle( wfMessage( 'viewsource-title', $this->getContextTitle()->getPrefixedText() ) );
                $wgOut->addBacklinkSubtitle( $this->getContextTitle() );
                $wgOut->addWikiText( $wgOut->formatPermissionsErrorMessage( $permErrors, 'edit' ) );