{
$t = new Title();
$t->mDbkeyform = $key;
- $t->secureAndSplit();
+ if( $t->secureAndSplit() )
+ return $t;
+ else
+ return NULL;
return $t;
}
$t = new Title();
$t->mDbkeyform = str_replace( " ", "_", $text );
- $t->secureAndSplit();
-
- wfProfileOut();
- return $t;
+ if( $t->secureAndSplit() ) {
+ wfProfileOut();
+ return $t;
+ } else {
+ return NULL;
+ }
}
function newFromURL( $url )
$s = $wgLang->checkTitleEncoding( $s );
$t->mDbkeyform = str_replace( " ", "_", $s );
- $t->secureAndSplit();
- return $t;
+ if( $t->secureAndSplit() ) {
+ return $t;
+ } else {
+ return NULL;
+ }
}
function nameOf( $id )
{
$t = new Title();
$t->mDbkeyform = Title::makeName( $ns, $title );
- $t->secureAndSplit();
- return $t;
+ if( $t->secureAndSplit() ) {
+ return $t;
+ } else {
+ return NULL;
+ }
}
function getPrefixedDBkey()
if ( "_" == $t{0} ) { $t = substr( $t, 1 ); }
$l = strlen( $t );
if ( $l && ( "_" == $t{$l-1} ) ) { $t = substr( $t, 0, $l-1 ); }
- if ( "" == $t ) { $t = "_"; }
+ if ( "" == $t ) {
+ wfProfileOut();
+ return false;
+ }
$this->mDbkeyform = $t;
$done = false;
$this->mTextform = str_replace( "_", " ", $t );
wfProfileOut();
+ return true;
}
}
?>