r58004 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58003‎ | r58004 | r58005 >
Date:13:55, 22 October 2009
Author:werdna
Status:deferred
Tags:
Comment:
LiquidThreads: Show signature after edit box and preview content, to signal that the comments are pre-signed
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/View.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/View.php
@@ -416,6 +416,11 @@
417417 $this->perpetuate( 'lqt_operand', 'hidden' ) .
418418 Xml::hidden( 'lqt_nonce', wfGenerateToken() ) .
419419 Xml::hidden( 'offset', $offset );
 420+
 421+ $e->editFormTextAfterContent .=
 422+ Xml::tags( 'p', null, $this->getSignature( $this->user ) );
 423+ $e->previewTextAfterContent .=
 424+ Xml::tags( 'p', null, $this->getSignature( $this->user ) );
420425
421426 // Add a one-time random string to a hidden field. Store the random string
422427 // in memcached on submit and don't allow the edit to go ahead if it's already
@@ -424,13 +429,11 @@
425430 if ( $submitted_nonce ) {
426431 global $wgMemc;
427432
428 - $key = wfMemcKey( 'lqt-nonce', $submitted_nonce, $this->user->getName() );
429 - if ( $wgMemc->get( $key ) ) {
 433+ $nonce_key = wfMemcKey( 'lqt-nonce', $submitted_nonce, $this->user->getName() );
 434+ if ( $wgMemc->get( $nonce_key ) ) {
430435 $this->output->redirect( $this->article->getTitle()->getFullURL() );
431436 return;
432437 }
433 -
434 - $wgMemc->set( $key, 1, 3600 );
435438 }
436439
437440 if ( $subject_expected ) {
@@ -460,6 +463,10 @@
461464 $this->article, $subject, $e->summary, $thread,
462465 $e->textbox1
463466 );
 467+
 468+ if ( $submitted_nonce && $nonce_key ) {
 469+ $wgMemc->set( $nonce_key, 1, 3600 );
 470+ }
464471 }
465472
466473 // A redirect without $e->didSave will happen if the new text is blank (EditPage::attemptSave).

Status & tagging log