# We shouldn't need to query the DB for the size.
#$maxSize = $dbr->textFieldSize( 'page', 'page_title' );
if ( strlen( $r ) > 255 ) {
+ wfProfileOut( $fname );
return false;
}
$t = $r;
}
+ /**
+ * Can't make a link to a namespace alone...
+ * "empty" local links can only be self-links
+ * with a fragment identifier.
+ */
+ if( $t == '' &&
+ $this->mInterwiki == '' &&
+ $this->mNamespace != NS_MAIN ) {
+ wfProfileOut( $fname );
+ return false;
+ }
+
# Fill fields
$this->mDbkeyform = $t;
$this->mUrlform = wfUrlencode( $t );
!!end
+!! test
+Namespaced link must have a title
+!! input
+[[Project:]]
+!! result
+<p>[[Project:]]
+</p>
+!!end
+
+!! test
+Namespaced link must have a title (bad fragment version)
+!! input
+[[Project:#fragment]]
+!! result
+<p>[[Project:#fragment]]
+</p>
+!!end
+
TODO:
more images
more tables