Made an update to YAMBE that you might want to include
function linkFromText( $page, $displayText, $nsID = 0 ) { $title = Title::newFromText( trim( $page ), $nsID ); if ( !is_null( $title ) ) { return Linker::linkKnown( $title, $displayText ); } else { return ""; } }