Merge "TitleValue: Include the invalid DB key in the message when throwing"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sat, 31 Dec 2016 11:10:46 +0000 (11:10 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sat, 31 Dec 2016 11:10:46 +0000 (11:10 +0000)
includes/title/TitleValue.php

index 597bf2f..7c370f1 100644 (file)
@@ -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;