Merge "(bug 30410) Remove deprecated $wgFilterCallback. The 'filtered' API error...
authorBrion VIBBER <brion@wikimedia.org>
Thu, 26 Apr 2012 23:15:16 +0000 (23:15 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 26 Apr 2012 23:15:16 +0000 (23:15 +0000)
1  2 
RELEASE-NOTES-1.20
includes/EditPage.php

diff --combined RELEASE-NOTES-1.20
@@@ -44,7 -44,6 +44,7 @@@ production
    $wgDebugLogFile['memcached'] to some filepath.
  * (bug 35685) api.php URL and other entry point URLs are now listed on
    Special:Version
 +* Edit notices can now be translated.
  
  === Bug fixes in 1.20 ===
  * (bug 30245) Use the correct way to construct a log page title.
@@@ -89,6 -88,7 +89,7 @@@
  * (bug 33564) transwiki import sometimes result in invalid title.
  * (bug 35572) Blocks appear to succeed even if query fails due to wrong DB structure
  * (bug 31757) Add a word-separator between help-messages in HTMLForm
+ * (bug 30410) Removed deprecated $wgFilterCallback and the 'filtered' API error.
  
  === API changes in 1.20 ===
  * (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
diff --combined includes/EditPage.php
@@@ -36,11 -36,6 +36,6 @@@ class EditPage 
         */
        const AS_HOOK_ERROR                = 210;
  
-       /**
-        * Status: The filter function set in $wgFilterCallback returned true (= block it)
-        */
-       const AS_FILTERING                 = 211;
        /**
         * Status: A hook function returned an error
         */
                                return true;
  
                        case self::AS_HOOK_ERROR:
-                       case self::AS_FILTERING:
                                return false;
  
                        case self::AS_SUCCESS_NEW_ARTICLE:
         * AS_CONTENT_TOO_BIG and AS_BLOCKED_PAGE_FOR_USER. All that stuff needs to be cleaned up some time.
         */
        function internalAttemptSave( &$result, $bot = false ) {
-               global $wgFilterCallback, $wgUser, $wgRequest, $wgParser;
-               global $wgMaxArticleSize;
+               global $wgUser, $wgRequest, $wgParser, $wgMaxArticleSize;
  
                $status = Status::newGood();
  
                        wfProfileOut( __METHOD__ );
                        return $status;
                }
-               if ( $wgFilterCallback && is_callable( $wgFilterCallback ) && $wgFilterCallback( $this->mTitle, $this->textbox1, $this->section, $this->hookError, $this->summary ) ) {
-                       # Error messages or other handling should be performed by the filter function
-                       $status->setResult( false, self::AS_FILTERING );
-                       wfProfileOut( __METHOD__ . '-checks' );
-                       wfProfileOut( __METHOD__ );
-                       return $status;
-               }
                if ( !wfRunHooks( 'EditFilter', array( $this, $this->textbox1, $this->section, &$this->hookError, $this->summary ) ) ) {
                        # Error messages etc. could be handled within the hook...
                        $status->fatal( 'hookaborted' );
  
                # Optional notices on a per-namespace and per-page basis
                $editnotice_ns = 'editnotice-' . $this->mTitle->getNamespace();
 -              $editnotice_ns_message = wfMessage( $editnotice_ns )->inContentLanguage();
 +              $editnotice_ns_message = wfMessage( $editnotice_ns );
                if ( $editnotice_ns_message->exists() ) {
                        $wgOut->addWikiText( $editnotice_ns_message->plain() );
                }
                        $editnotice_base = $editnotice_ns;
                        while ( count( $parts ) > 0 ) {
                                $editnotice_base .= '-' . array_shift( $parts );
 -                              $editnotice_base_msg = wfMessage( $editnotice_base )->inContentLanguage();
 +                              $editnotice_base_msg = wfMessage( $editnotice_base );
                                if ( $editnotice_base_msg->exists() ) {
                                        $wgOut->addWikiText( $editnotice_base_msg->plain() );
                                }
                } else {
                        # Even if there are no subpages in namespace, we still don't want / in MW ns.
                        $editnoticeText = $editnotice_ns . '-' . str_replace( '/', '-', $this->mTitle->getDBkey() );
 -                      $editnoticeMsg = wfMessage( $editnoticeText )->inContentLanguage();
 +                      $editnoticeMsg = wfMessage( $editnoticeText );
                        if ( $editnoticeMsg->exists() ) {
                                $wgOut->addWikiText( $editnoticeMsg->plain() );
                        }