*/
protected $interwiki;
+ /**
+ * Text form including namespace/interwiki, initialised on demand
+ *
+ * Only public to share cache with TitleFormatter
+ *
+ * @private
+ * @var string
+ */
+ public $prefixedText = null;
+
/**
* Constructs a TitleValue.
*
// Sanity check, no full validation or normalization applied here!
Assert::parameter( !preg_match( '/^_|[ \r\n\t]|_$/', $dbkey ), '$dbkey',
"invalid DB key '$dbkey'" );
- Assert::parameter( $dbkey !== '', '$dbkey', 'should not be empty' );
+ Assert::parameter( $dbkey !== '' || ( $fragment !== '' && $namespace === NS_MAIN ),
+ '$dbkey', 'should not be empty unless namespace is main and fragment is non-empty' );
$this->namespace = $namespace;
$this->dbkey = $dbkey;
* @return string
*/
public function getText() {
- return str_replace( '_', ' ', $this->getDBkey() );
+ return str_replace( '_', ' ', $this->dbkey );
}
/**