X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ftitle%2FTitleValue.php;h=722e5ef91d2760302af04d8aa3fb568aac8691a7;hb=34582db81c9418a12721df58081c02bb05d2660a;hp=698bc4f8be88e85a8db2fee0a86abda07eefdf05;hpb=f7b7d9400d993abb545db503d30e20206689a1e1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/title/TitleValue.php b/includes/title/TitleValue.php index 698bc4f8be..722e5ef91d 100644 --- a/includes/title/TitleValue.php +++ b/includes/title/TitleValue.php @@ -103,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;