2010 September, 17 (Guerric)

    Table of contents
    No headers
    http://bugs.developer.mindtouch.com/view.php?id=8480
    // Paste PHP Code
    Index: special_pageemail.php
    ===================================================================
    --- special_pageemail.php    (revision 21818)
    +++ special_pageemail.php    (working copy)
    @@ -40,8 +40,8 @@
     
     class SpecialPageEmail extends SpecialPagePlugin
     {
    -
         protected $pageName = 'PageEmail';
    +    protected $allowAnonymous = false;
        
         public function output(&$html, &$subhtml)
         {
    @@ -51,6 +51,19 @@
             $this->User = DekiUser::getCurrent();
             $this->Title = Title::newFromId($this->Request->getVal('pageid', 0));
            
    +        if (is_null($this->Title))
    +        {
    +            self::redirectHome();
    +            return;
    +        }
    +        
    +        // bugfix #8480: Email link feature should be blocked for banned users
    +        if ($this->User->isDisabled())
    +        {
    +            self::redirectHome();
    +            return;
    +        }
    +        
             if ($this->Request->isPost())
             {
                 if ($this->emailPage())
    @@ -58,11 +71,7 @@
                     self::redirect($this->Title->getLocalUrl());
                 }
             }
    -        if (is_null($this->Title))
    -        {
    -            self::redirectHome();
    -            return;
    -        }
    +
             $html .= $this->getEmailForm();
             $subhtml = wfMsg('Page.PageEmail.return-to', $this->Title->getLocalUrl(), $this->Title->getPrefixedText());
    Tag page
    You must login to post a comment.

    Copyright © 2011 MindTouch, Inc. Powered by