First half of fix for bug #30332 ("API spamblocklist error should provide *all* block...
authorjarry1250 <jarry1250@gmail.com>
Mon, 26 Mar 2012 21:50:34 +0000 (22:50 +0100)
committerjarry1250 <jarry1250@gmail.com>
Mon, 26 Mar 2012 21:50:34 +0000 (22:50 +0100)
Allow spamPageWithContent() to accept an array of matches, rather than just one.

Not dependent on other half of fix.

Change-Id: I75faac51f24bbb2569b36bc2e44f3cd5c43b1bd7

includes/EditPage.php

index 8f4761c..31e6626 100644 (file)
@@ -3027,12 +3027,15 @@ HTML
        /**
         * Show "your edit contains spam" page with your diff and text
         *
-        * @param $match string|bool Text which triggered one or more filters
+        * @param $match string|Array|bool Text (or array of texts) which triggered one or more filters
         */
        public function spamPageWithContent( $match = false ) {
-               global $wgOut;
+               global $wgOut, $wgLang;
                $this->textbox2 = $this->textbox1;
 
+               if( is_array( $match ) ){
+                       $match = $wgLang->listToText( $match );
+               }
                $wgOut->prepareErrorPage( wfMessage( 'spamprotectiontitle' ) );
 
                $wgOut->addHTML( '<div id="spamprotected">' );