diff options
author | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2022-06-17 03:20:47 +0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2022-06-17 03:20:47 +0300 |
commit | 9e554da5d88529ef3c543b15711fc8a0e65ec53d (patch) | |
tree | 075e49b3ada109b8ae8d74a172a620de470b4c92 | |
parent | b6ba5391948c0b1fb7fa9732d0cfe02f435e941f (diff) |
Fix Symfony exception when db/table has two %%
Fixes https://github.com/phpmyadmin/phpmyadmin/issues/17584
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | libraries/classes/Common.php | 7 |
2 files changed, 6 insertions, 2 deletions
@@ -16,6 +16,7 @@ phpMyAdmin - ChangeLog - issue #17121 Fix password_hash function incorrectly adding single quotes to password before hashing - issue #17586 Fix statistics not showing for empty databases - issue #17592 Clicking on the New index link on the sidebar does not throw an error anymore +- issue #17584 It's now possible to browse a database that includes two % in its name 5.2.0 (2022-05-10) - issue #16521 Upgrade Bootstrap to version 5 diff --git a/libraries/classes/Common.php b/libraries/classes/Common.php index ec06fcf017..635dc69c33 100644 --- a/libraries/classes/Common.php +++ b/libraries/classes/Common.php @@ -39,6 +39,7 @@ use function mb_strrpos; use function mb_substr; use function register_shutdown_function; use function session_id; +use function str_replace; use function strlen; use function trigger_error; use function urldecode; @@ -526,8 +527,10 @@ final class Common $urlParams['db'] = $db; $urlParams['table'] = $table; - $containerBuilder->setParameter('db', $db); - $containerBuilder->setParameter('table', $table); + // If some parameter value includes the % character, you need to escape it by adding + // another % so Symfony doesn't consider it a reference to a parameter name. + $containerBuilder->setParameter('db', str_replace('%', '%%', $db)); + $containerBuilder->setParameter('table', str_replace('%', '%%', $table)); $containerBuilder->setParameter('url_params', $urlParams); } |