Index: trunk/extensions/SemanticForms/includes/SF_ParserFunctions.php |
— | — | @@ -237,10 +237,13 @@ |
238 | 238 | $str .= Xml::element( 'input', array( 'type' => 'submit', 'value' => $inLinkStr ) ); |
239 | 239 | $str .= "$hidden_inputs</form>"; |
240 | 240 | } 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 | + } |
245 | 248 | } |
246 | 249 | $str = "<a href=\"$link_url\" class=\"$classStr\">$inLinkStr</a>"; |
247 | 250 | } |