X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FEditPage.php;h=68691c5cd46ae37332ca601ed765fc45312fdb53;hb=3195d2ab7ff55e2633ddcfa86188f61f1fd26184;hp=63e3e668268e8ca765756b8b1e84ee4b977e2ad9;hpb=c38d687a3fe8e084f75472041f55818ac3424b01;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index 63e3e66826..68691c5cd4 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -840,7 +840,6 @@ class EditPage { if ( $this->textbox1 === false ) { return false; } - wfProxyCheck(); return true; } @@ -1382,6 +1381,24 @@ class EditPage { return $status; } + $spam = $wgRequest->getText( 'wpAntispam' ); + if ( $spam !== '' ) { + wfDebugLog( + 'SimpleAntiSpam', + $wgUser->getName() . + ' editing "' . + $this->mTitle->getPrefixedText() . + '" submitted bogus field "' . + $spam . + '"' + ); + $status->fatal( 'spamprotectionmatch', false ); + $status->value = self::AS_SPAM_ERROR; + wfProfileOut( __METHOD__ . '-checks' ); + wfProfileOut( __METHOD__ ); + return $status; + } + try { # Construct Content object $textbox_content = $this->toEditContent( $this->textbox1 ); @@ -1493,7 +1510,7 @@ class EditPage { wfProfileOut( __METHOD__ ); return $status; } - if ( $wgUser->pingLimiter() ) { + if ( $wgUser->pingLimiter() || $wgUser->pingLimiter( 'linkpurge', 0 ) ) { $status->fatal( 'actionthrottledtext' ); $status->value = self::AS_RATE_LIMITED; wfProfileOut( __METHOD__ . '-checks' ); @@ -1771,6 +1788,10 @@ class EditPage { } $result['nullEdit'] = $doEditStatus->hasMessage( 'edit-no-change' ); + if ( $result['nullEdit'] ) { + // We don't know if it was a null edit until now, so increment here + $wgUser->pingLimiter( 'linkpurge' ); + } $result['redirect'] = $content->isRedirect(); $this->updateWatchlist(); wfProfileOut( __METHOD__ ); @@ -2187,6 +2208,14 @@ class EditPage { call_user_func_array( $formCallback, array( &$wgOut ) ); } + // Add an empty field to trip up spambots + $wgOut->addHTML( + Xml::openElement( 'div', array( 'id' => 'antispam-container', 'style' => 'display: none;' ) ) + . Html::rawElement( 'label', array( 'for' => 'wpAntiSpam' ), wfMessage( 'simpleantispam-label' )->parse() ) + . Xml::element( 'input', array( 'type' => 'text', 'name' => 'wpAntispam', 'id' => 'wpAntispam', 'value' => '' ) ) + . Xml::closeElement( 'div' ) + ); + wfRunHooks( 'EditPage::showEditForm:fields', array( &$this, &$wgOut ) ); // Put these up at the top to ensure they aren't lost on early form submission @@ -2855,7 +2884,15 @@ HTML return self::getCopyrightWarning( $this->mTitle ); } - public static function getCopyrightWarning( $title ) { + /** + * Get the copyright warning, by default returns wikitext + * + * @param Title $title + * @param string $format output format, valid values are any function of + * a Message object + * @return string + */ + public static function getCopyrightWarning( $title, $format = 'plain' ) { global $wgRightsText; if ( $wgRightsText ) { $copywarnMsg = array( 'copyrightwarning', @@ -2869,7 +2906,7 @@ HTML wfRunHooks( 'EditPageCopyrightWarning', array( $title, &$copywarnMsg ) ); return "
\n" . - call_user_func_array( 'wfMessage', $copywarnMsg )->plain() . "\n
"; + call_user_func_array( 'wfMessage', $copywarnMsg )->$format() . "\n"; } /** @@ -2900,7 +2937,7 @@ HTML foreach ( $output->getLimitReportData() as $key => $value ) { if ( wfRunHooks( 'ParserLimitReportFormat', - array( $key, $value, &$limitReport, true, true ) + array( $key, &$value, &$limitReport, true, true ) ) ) { $keyMsg = wfMessage( $key ); $valueMsg = wfMessage( array( "$key-value-html", "$key-value" ) );