From 9f9a988e0656b7f08a4cbf0ebf6c356bdd806aa6 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 10 Oct 2003 20:56:51 +0000 Subject: [PATCH] Skip links with namespace but no title --- includes/OutputPage.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 18fefbb1a5..4f5a53e4d4 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -977,8 +977,10 @@ $t[] = "" ; if ( preg_match( "/^((?:i|x|[a-z]{2,3})(?:-[a-z0-9]+)?|[A-Za-z\\x80-\\xff]+):(.*)\$/", $link, $m ) ) { $pre = strtolower( $m[1] ); - $suf = $m[2]; - if ( $wgLang->getNsIndex( $pre ) == + $suf = trim($m[2]); + if( empty( $suf ) ) { + $s .= $trail; + } else if ( $wgLang->getNsIndex( $pre ) == Namespace::getImage() ) { $nt = Title::newFromText( $suf ); $name = $nt->getDBkey(); -- 2.20.1