r109387 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109386‎ | r109387 | r109388 >
Date:16:26, 18 January 2012
Author:yaron
Status:ok
Tags:
Comment:
Added handling for 'redlink=1' in query string, in MediaWiki style
Modified paths:
  • /trunk/extensions/SemanticForms/specials/SF_FormEdit.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/specials/SF_FormEdit.php
@@ -126,6 +126,15 @@
127127 $page_contents = null;
128128 //$page_is_source = false;
129129 } else {
 130+ // If page already exists and 'redlink'
 131+ // is in the query string, redirect to
 132+ // the actual page, just like
 133+ // MediaWiki does it.
 134+ if ( $wgRequest->getBool( 'redlink' ) ) {
 135+ $wgOut->redirect( $target_title->getFullURL() );
 136+ wfProfileOut( __METHOD__ );
 137+ return;
 138+ }
130139 $target_article = new Article( $target_title, 0 );
131140 $page_contents = $target_article->getContent();
132141 //$page_is_source = true;
@@ -344,7 +353,7 @@
345354 } else {
346355 // Lets other code process additional form-definition syntax
347356 wfRunHooks( 'sfWritePageData', array( $form_name, $target_title, &$data_text ) );
348 - $text = SFUtils::printRedirectForm( $target_title, $data_text, $wgRequest->getVal( 'wpSummary' ), $save_page, $preview_page, $diff_page, $wgRequest->getCheck( 'wpMinoredit' ), $wgRequest->getCheck( 'wpWatchthis' ), $wgRequest->getVal( 'wpStarttime' ), $wgRequest->getVal( 'wpEdittime' ) ); // extract its data
 357+ $text = SFUtils::printRedirectForm( $target_title, $data_text, $wgRequest->getVal( 'wpSummary' ), $save_page, $preview_page, $diff_page, $wgRequest->getCheck( 'wpMinoredit' ), $wgRequest->getCheck( 'wpWatchthis' ), $wgRequest->getVal( 'wpStarttime' ), $wgRequest->getVal( 'wpEdittime' ) ); // extract its data
349358 }
350359
351360

Status & tagging log