Index: trunk/phase3/includes/Linker.php |
— | — | @@ -1053,6 +1053,7 @@ |
1054 | 1054 | $text = $match[1]; |
1055 | 1055 | } |
1056 | 1056 | $submatch = array(); |
| 1057 | + $thelink = null; |
1057 | 1058 | if( preg_match( '/^' . $medians . '(.*)$/i', $match[1], $submatch ) ) { |
1058 | 1059 | # Media link; trail not supported. |
1059 | 1060 | $linkRegexp = '/^(.*?)\]\]/'; |
— | — | @@ -1087,7 +1088,10 @@ |
1088 | 1089 | ) . $trail; |
1089 | 1090 | } |
1090 | 1091 | } |
1091 | | - $comment = preg_replace( $linkRegexp, StringUtils::escapeRegexReplacement( $thelink ), $comment, 1 ); |
| 1092 | + if( $thelink ) { |
| 1093 | + // If the link is still valid, go ahead and replace it in! |
| 1094 | + $comment = preg_replace( $linkRegexp, StringUtils::escapeRegexReplacement( $thelink ), $comment, 1 ); |
| 1095 | + } |
1092 | 1096 | |
1093 | 1097 | return $comment; |
1094 | 1098 | } |