Index: trunk/extensions/LiquidThreads/classes/LqtView.php |
— | — | @@ -272,7 +272,7 @@ |
273 | 273 | $t = $this->newSummaryTitle( $edit_applies_to ); |
274 | 274 | $article = new Article( $t ); |
275 | 275 | } elseif ( $thread == null ) { |
276 | | - if ( is_null( Title::makeTitleSafe( NS_LQT_THREAD, $subject ) ) ) { |
| 276 | + if ( $subject && is_null( Title::makeTitleSafe( NS_LQT_THREAD, $subject ) ) ) { |
277 | 277 | // Dodgy title |
278 | 278 | $valid_subject = false; |
279 | 279 | $t = $this->scratchTitle(); |
— | — | @@ -298,7 +298,7 @@ |
299 | 299 | wfMsgExt( 'lqt_invalid_subject', 'parse' ) ); |
300 | 300 | } |
301 | 301 | |
302 | | - if ( $subject && $subject != $thread->subjectWithoutIncrement() && |
| 302 | + if ( $subject && $thread && $subject != $thread->subjectWithoutIncrement() && |
303 | 303 | !$this->user->isAllowed( 'move' ) ) { |
304 | 304 | $e->editFormPageTop .= |
305 | 305 | Xml::tags( 'div', array( 'class' => 'error' ), |
— | — | @@ -310,8 +310,8 @@ |
311 | 311 | $wgRequest->setVal( 'lqt_subject_field', $thread->subjectWithoutIncrement() ); |
312 | 312 | } |
313 | 313 | |
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' |
316 | 316 | global $wgRequest; |
317 | 317 | $wgRequest->setVal( 'wpPreview', true ); |
318 | 318 | } |
— | — | @@ -329,7 +329,7 @@ |
330 | 330 | $subject_label = wfMsg( 'lqt_subject' ); |
331 | 331 | |
332 | 332 | $disableattr = array(); |
333 | | - if ( !$this->user->isAllowed( 'move' ) ) { |
| 333 | + if ( $thread && !$this->user->isAllowed( 'move' ) ) { |
334 | 334 | $disableattr = array( 'readonly' => 'readonly' ); |
335 | 335 | } |
336 | 336 | |