From: Gergő Tisza Date: Wed, 3 Jul 2019 11:26:02 +0000 (+0000) Subject: Revert "rdbms: codify DatabaseDomain table "_" prefix convention" X-Git-Tag: 1.34.0-rc.0~1185^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=2dad39b5a778c1d472acff8e59188f22d73a8621;p=lhc%2Fweb%2Fwiklou.git Revert "rdbms: codify DatabaseDomain table "_" prefix convention" This partially reverts commit c4e284f1130cdc2a4811120594bdb8013d17eaaa (adding _ to prefixes in tests and readbility / code style fixes are preserved). It broke all installations which used a table prefix not ending in underscore. Bug: T227147 Change-Id: I99fc0a2f0fc7b5b321d75fd885763688f92f6d04 --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index a32af365d0..9b5a38ba02 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1958,7 +1958,8 @@ $wgSearchTypeAlternatives = null; /** * Table name prefix. - * This should be alphanumeric, contain neither spaces nor hyphens, and end in "_" + * Should be alphanumeric plus underscores, and not contain spaces nor hyphens. + * Suggested format ends with an underscore. */ $wgDBprefix = ''; diff --git a/includes/libs/rdbms/database/domain/DatabaseDomain.php b/includes/libs/rdbms/database/domain/DatabaseDomain.php index 5dd4b49fba..c1eceb0a83 100644 --- a/includes/libs/rdbms/database/domain/DatabaseDomain.php +++ b/includes/libs/rdbms/database/domain/DatabaseDomain.php @@ -53,9 +53,7 @@ class DatabaseDomain { } $this->schema = $schema; if ( !is_string( $prefix ) ) { - throw new InvalidArgumentException( 'Prefix must be a string.' ); - } elseif ( $prefix !== '' && substr( $prefix, -1, 1 ) !== '_' ) { - throw new InvalidArgumentException( 'A non-empty prefix must end with "_".' ); + throw new InvalidArgumentException( "Prefix must be a string." ); } $this->prefix = $prefix; }