X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ftitle%2FTitleValue.php;h=722e5ef91d2760302af04d8aa3fb568aac8691a7;hb=4d6828ef7835b7c5c5e903637fcba4bf5c487e1b;hp=43a399ab1cb98a25f159d35d5d7ef5ba6ec1fc77;hpb=5cd37c7a64e9abb4fdadb9c3ae10c672bdc40c11;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/title/TitleValue.php b/includes/title/TitleValue.php index 43a399ab1c..722e5ef91d 100644 --- a/includes/title/TitleValue.php +++ b/includes/title/TitleValue.php @@ -59,6 +59,16 @@ class TitleValue implements LinkTarget { */ 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. * @@ -93,7 +103,8 @@ class TitleValue implements LinkTarget { // 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;