r90959 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90958‎ | r90959 | r90960 >
Date:14:17, 28 June 2011
Author:yaron
Status:deferred
Tags:
Comment:
Follow-up to r90324 - red link is displayed only if a target is specified *and* the target page doesn't exist
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
@@ -237,10 +237,13 @@
238238 $str .= Xml::element( 'input', array( 'type' => 'submit', 'value' => $inLinkStr ) );
239239 $str .= "$hidden_inputs</form>";
240240 } else {
241 - // If target page doesn't exist, make it a red link
242 - $targetTitle = Title::newFromText( $inTargetName );
243 - if ( is_null( $targetTitle) || !$targetTitle->exists() ) {
244 - $classStr .= " new";
 241+ // If a target page has been specified but it doesn't
 242+ // exist, make it a red link.
 243+ if ( ! empty( $inTargetName ) ) {
 244+ $targetTitle = Title::newFromText( $inTargetName );
 245+ if ( is_null( $targetTitle) || !$targetTitle->exists() ) {
 246+ $classStr .= " new";
 247+ }
245248 }
246249 $str = "<a href=\"$link_url\" class=\"$classStr\">$inLinkStr</a>";
247250 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r90324Set #formlink to show a red link if target page doesn't exist; cleaned up cla...yaron23:19, 17 June 2011