Index: trunk/phase3/includes/EditPage.php |
— | — | @@ -2025,6 +2025,7 @@ |
2026 | 2026 | * Produce the stock "your edit contains spam" page |
2027 | 2027 | * |
2028 | 2028 | * @param $match Text which triggered one or more filters |
| 2029 | + * @deprecated Use method spamPageWithContent() instead |
2029 | 2030 | */ |
2030 | 2031 | static function spamPage( $match = false ) { |
2031 | 2032 | global $wgOut, $wgTitle; |
— | — | @@ -2044,6 +2045,38 @@ |
2045 | 2046 | } |
2046 | 2047 | |
2047 | 2048 | /** |
| 2049 | + * Show "your edit contains spam" page with your diff and text |
| 2050 | + * |
| 2051 | + * @param $match Text which triggered one or more filters |
| 2052 | + */ |
| 2053 | + public function spamPageWithContent( $match = false ) { |
| 2054 | + global $wgOut, $wgTitle; |
| 2055 | + $this->textbox2 = $this->textbox1; |
| 2056 | + |
| 2057 | + $wgOut->setPageTitle( wfMsg( 'spamprotectiontitle' ) ); |
| 2058 | + $wgOut->setRobotPolicy( 'noindex,nofollow' ); |
| 2059 | + $wgOut->setArticleRelated( false ); |
| 2060 | + |
| 2061 | + $wgOut->addHTML( '<div id="spamprotected">' ); |
| 2062 | + $wgOut->addWikiMsg( 'spamprotectiontext' ); |
| 2063 | + if ( $match ) { |
| 2064 | + $wgOut->addWikiMsg( 'spamprotectionmatch', wfEscapeWikiText( $match ) ); |
| 2065 | + } |
| 2066 | + $wgOut->addHTML( '</div>' ); |
| 2067 | + |
| 2068 | + $wgOut->wrapWikiMsg( '<h2>$1</h2>', "yourdiff" ); |
| 2069 | + $de = new DifferenceEngine( $this->mTitle ); |
| 2070 | + $de->setText( $this->getContent(), $this->textbox2 ); |
| 2071 | + $de->showDiff( wfMsg( "storedversion" ), wfMsg( "yourtext" ) ); |
| 2072 | + |
| 2073 | + $wgOut->wrapWikiMsg( '<h2>$1</h2>', "yourtext" ); |
| 2074 | + $this->showTextbox2(); |
| 2075 | + |
| 2076 | + $wgOut->addReturnTo( $wgTitle, array( 'action' => 'edit' ) ); |
| 2077 | + } |
| 2078 | + |
| 2079 | + |
| 2080 | + /** |
2048 | 2081 | * @private |
2049 | 2082 | * @todo document |
2050 | 2083 | */ |
— | — | @@ -2618,7 +2651,7 @@ |
2619 | 2652 | return false; |
2620 | 2653 | |
2621 | 2654 | case self::AS_SPAM_ERROR: |
2622 | | - self::spamPage( $resultDetails['spam'] ); |
| 2655 | + $this->spamPageWithContent( $resultDetails['spam'] ); |
2623 | 2656 | return false; |
2624 | 2657 | |
2625 | 2658 | case self::AS_BLOCKED_PAGE_FOR_USER: |