r51116 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51115‎ | r51116 | r51117 >
Date:14:01, 28 May 2009
Author:werdna
Status:deferred
Tags:
Comment:
Fix r51111, some bugs when creating a thread
Modified paths:
  • /trunk/extensions/LiquidThreads/classes/LqtView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LiquidThreads/classes/LqtView.php
@@ -272,7 +272,7 @@
273273 $t = $this->newSummaryTitle( $edit_applies_to );
274274 $article = new Article( $t );
275275 } elseif ( $thread == null ) {
276 - if ( is_null( Title::makeTitleSafe( NS_LQT_THREAD, $subject ) ) ) {
 276+ if ( $subject && is_null( Title::makeTitleSafe( NS_LQT_THREAD, $subject ) ) ) {
277277 // Dodgy title
278278 $valid_subject = false;
279279 $t = $this->scratchTitle();
@@ -298,7 +298,7 @@
299299 wfMsgExt( 'lqt_invalid_subject', 'parse' ) );
300300 }
301301
302 - if ( $subject && $subject != $thread->subjectWithoutIncrement() &&
 302+ if ( $subject && $thread && $subject != $thread->subjectWithoutIncrement() &&
303303 !$this->user->isAllowed( 'move' ) ) {
304304 $e->editFormPageTop .=
305305 Xml::tags( 'div', array( 'class' => 'error' ),
@@ -310,8 +310,8 @@
311311 $wgRequest->setVal( 'lqt_subject_field', $thread->subjectWithoutIncrement() );
312312 }
313313
314 - if ( !$valid_subject || $failed_rename ) {
315 - // Dirty hack to prevent saving from going ahead
 314+ if ( (!$valid_subject && $subject) || $failed_rename ) {
 315+ // Dirty hack to prevent saving from going ahead'
316316 global $wgRequest;
317317 $wgRequest->setVal( 'wpPreview', true );
318318 }
@@ -329,7 +329,7 @@
330330 $subject_label = wfMsg( 'lqt_subject' );
331331
332332 $disableattr = array();
333 - if ( !$this->user->isAllowed( 'move' ) ) {
 333+ if ( $thread && !$this->user->isAllowed( 'move' ) ) {
334334 $disableattr = array( 'readonly' => 'readonly' );
335335 }
336336

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r51111Fix bug 18947 "LiquidThreads thread renaming silently fails if user is not al...werdna12:39, 28 May 2009

Status & tagging log