From: This, that and the other Date: Sat, 31 Dec 2016 05:30:32 +0000 (+1100) Subject: TitleValue: Include the invalid DB key in the message when throwing X-Git-Tag: 1.31.0-rc.0~4439^2 X-Git-Url: http://git.cyclocoop.org/%7D%7Cconcat%7B?a=commitdiff_plain;h=100bebdbfa8baa2b945874e2b11281898660dcc1;p=lhc%2Fweb%2Fwiklou.git TitleValue: Include the invalid DB key in the message when throwing The current output "Bad value for parameter $dbkey: invalid DB key" is useless for actually working out which DB key is to blame. Bug: T146778 Change-Id: Iaf57e25ab27b5065469c5dc5de0a1b881c48210c --- diff --git a/includes/title/TitleValue.php b/includes/title/TitleValue.php index 597bf2f4ee..7c370f1ae5 100644 --- a/includes/title/TitleValue.php +++ b/includes/title/TitleValue.php @@ -78,7 +78,8 @@ class TitleValue implements LinkTarget { Assert::parameterType( 'string', $interwiki, '$interwiki' ); // Sanity check, no full validation or normalization applied here! - Assert::parameter( !preg_match( '/^_|[ \r\n\t]|_$/', $dbkey ), '$dbkey', 'invalid DB key' ); + Assert::parameter( !preg_match( '/^_|[ \r\n\t]|_$/', $dbkey ), '$dbkey', + "invalid DB key '$dbkey'" ); Assert::parameter( $dbkey !== '', '$dbkey', 'should not be empty' ); $this->namespace = $namespace;