From b86d15a7666c5496f776e8edfb450935703e0f1a Mon Sep 17 00:00:00 2001 From: SagePtr Date: Tue, 1 Nov 2022 02:00:10 +0200 Subject: [PATCH] [ticket/17056] Fix PHP 8.2 deprecation warning about ${var} syntax The "${var}" style of string interpolation is deprecated in PHP 8.2, using "{$var}" syntax instead. PHPBB3-17056 --- phpBB/phpbb/db/tools/mssql.php | 2 +- phpBB/phpbb/db/tools/postgres.php | 2 +- phpBB/phpbb/db/tools/tools.php | 2 +- tests/functional/acp_permissions_test.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/phpbb/db/tools/mssql.php b/phpBB/phpbb/db/tools/mssql.php index 1653abeec0..bcbd047066 100644 --- a/phpBB/phpbb/db/tools/mssql.php +++ b/phpBB/phpbb/db/tools/mssql.php @@ -182,7 +182,7 @@ class mssql extends tools if (isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'] && strlen($column_name) > 26) // "${column_name}_gen" { - trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR); + trigger_error("Index name '{$column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR); } // here we add the definition of the new column to the list of columns diff --git a/phpBB/phpbb/db/tools/postgres.php b/phpBB/phpbb/db/tools/postgres.php index a19469910e..748d0c0821 100644 --- a/phpBB/phpbb/db/tools/postgres.php +++ b/phpBB/phpbb/db/tools/postgres.php @@ -147,7 +147,7 @@ class postgres extends tools if (isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'] && strlen($column_name) > 26) // "${column_name}_gen" { - trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR); + trigger_error("Index name '{$column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR); } // here we add the definition of the new column to the list of columns diff --git a/phpBB/phpbb/db/tools/tools.php b/phpBB/phpbb/db/tools/tools.php index 1250a8901d..0531d9c40a 100644 --- a/phpBB/phpbb/db/tools/tools.php +++ b/phpBB/phpbb/db/tools/tools.php @@ -275,7 +275,7 @@ class tools implements tools_interface if (isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'] && strlen($column_name) > 26) // "${column_name}_gen" { - trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR); + trigger_error("Index name '{$column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR); } // here we add the definition of the new column to the list of columns diff --git a/tests/functional/acp_permissions_test.php b/tests/functional/acp_permissions_test.php index 36cbbf2359..ddd519506f 100644 --- a/tests/functional/acp_permissions_test.php +++ b/tests/functional/acp_permissions_test.php @@ -92,7 +92,7 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case public function test_change_permission($description, $permission_type, $permission, $mode, $object_name, $object_id) { // Get the form - $crawler = self::request('GET', "adm/index.php?i=acp_permissions&icat=16&mode=$mode&${object_name}[0]=$object_id&type=$permission_type&sid=" . $this->sid); + $crawler = self::request('GET', "adm/index.php?i=acp_permissions&icat=16&mode=$mode&{$object_name}[0]=$object_id&type=$permission_type&sid=" . $this->sid); $this->assertStringContainsString($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text()); // XXX globals for \phpbb\auth\auth, refactor it later