From 6de48ce8c180b426a5781e9388e49ce1a4ea51ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 7 Jan 2016 11:32:51 +0100 Subject: [PATCH] Fix creating/editing VIEW with DEFINER containing special chars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #11826 Signed-off-by: Michal Čihař --- ChangeLog | 1 + view_create.php | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a17b23844b..07a11d3bce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ phpMyAdmin - ChangeLog - issue #11798 Fix handling of databases with dot in a name - issue #11820 Fix hiding of page content behind menu - issue #11780 FROM clause not generated after loading search bookmark +- issue #11826 Fix creating/editing VIEW with DEFINER containing special chars 4.5.3.1 (2015-12-25) - issue #11774 Undefined offset 2 diff --git a/view_create.php b/view_create.php index 5ea2aa3364..3ec2ef7c50 100644 --- a/view_create.php +++ b/view_create.php @@ -58,7 +58,9 @@ if (isset($_REQUEST['createview']) || isset($_REQUEST['alterview'])) { } if (! empty($_REQUEST['view']['definer'])) { - $sql_query .= $sep . ' DEFINER = ' . $_REQUEST['view']['definer']; + $arr = explode('@', $_REQUEST['view']['definer']); + $sql_query .= $sep . 'DEFINER=' . PMA_Util::backquote($arr[0]); + $sql_query .= '@' . PMA_Util::backquote($arr[1]) . ' '; } if (isset($_REQUEST['view']['sql_security'])) {