Reported bug: PHP Notice: Undefined variable: thelink in /var/www/w/includes/Linker.php on line 1090 on hitting http://translatewiki.net/w/i.php?title=Special:Log&dir=prev&user=Siebrand
Weren't properly checking for the case where we end up with an invalid link at the end.
$text = $match[1];
}
$submatch = array();
+ $thelink = null;
if( preg_match( '/^' . $medians . '(.*)$/i', $match[1], $submatch ) ) {
# Media link; trail not supported.
$linkRegexp = '/^(.*?)\]\]/';
) . $trail;
}
}
- $comment = preg_replace( $linkRegexp, StringUtils::escapeRegexReplacement( $thelink ), $comment, 1 );
+ if( $thelink ) {
+ // If the link is still valid, go ahead and replace it in!
+ $comment = preg_replace( $linkRegexp, StringUtils::escapeRegexReplacement( $thelink ), $comment, 1 );
+ }
return $comment;
}