http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90959
Revision: 90959
Author: yaron
Date: 2011-06-28 14:17:32 +0000 (Tue, 28 Jun 2011)
Log Message:
-----------
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: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
===================================================================
--- trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
2011-06-28 14:12:40 UTC (rev 90958)
+++ trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php
2011-06-28 14:17:32 UTC (rev 90959)
@@ -237,10 +237,13 @@
$str .= Xml::element( 'input', array( 'type' =>
'submit', 'value' => $inLinkStr ) );
$str .= "$hidden_inputs</form>";
} else {
- // If target page doesn't exist, make it a red link
- $targetTitle = Title::newFromText( $inTargetName );
- if ( is_null( $targetTitle) || !$targetTitle->exists()
) {
- $classStr .= " new";
+ // If a target page has been specified but it doesn't
+ // exist, make it a red link.
+ if ( ! empty( $inTargetName ) ) {
+ $targetTitle = Title::newFromText(
$inTargetName );
+ if ( is_null( $targetTitle) ||
!$targetTitle->exists() ) {
+ $classStr .= " new";
+ }
}
$str = "<a href=\"$link_url\"
class=\"$classStr\">$inLinkStr</a>";
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs