Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeven Bansod <devenbansod.bits@gmail.com>2016-11-08 07:44:20 +0300
committerDeven Bansod <devenbansod.bits@gmail.com>2016-11-08 07:44:23 +0300
commit670359777263517b92908677fafc7e8dcd377ec5 (patch)
tree4d569b4b6bfc5ad68571b6d4dcf93ffcd1aff998 /libraries
parent337b38044ddfe74d334831390c6cb40cd2f001f1 (diff)
Handle multiple `:p` while sanitizing MySQL hosts
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
Diffstat (limited to 'libraries')
-rw-r--r--libraries/core.lib.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/libraries/core.lib.php b/libraries/core.lib.php
index 71b7eec736..7924ffa174 100644
--- a/libraries/core.lib.php
+++ b/libraries/core.lib.php
@@ -891,7 +891,7 @@ if (! function_exists('hash_hmac')) {
/**
* Sanitizes MySQL hostname
*
- * * strips p: prefix
+ * * strips p: prefix(es)
*
* @param string $name User given hostname
*
@@ -899,8 +899,8 @@ if (! function_exists('hash_hmac')) {
*/
function PMA_sanitizeMySQLHost($name)
{
- if (strtolower(substr($name, 0, 2)) == 'p:') {
- return substr($name, 2);
+ while (strtolower(substr($name, 0, 2)) == 'p:') {
+ $name = substr($name, 2);
}
return $name;