' . "\n"
+ . $query_base;
} elseif (isset($query_base)) {
$query_base = self::formatSql($query_base);
}
@@ -1234,7 +1236,9 @@ class Util
// even if the query is big and was truncated, offer the chance
// to edit it (unless it's enormous, see linkOrButton() )
- if (! empty($cfg['SQLQuery']['Edit'])) {
+ if (! empty($cfg['SQLQuery']['Edit'])
+ && empty($GLOBALS['show_as_php'])
+ ) {
$edit_link .= PMA_URL_getCommon($url_params) . '#querybox';
$edit_link = ' ['
. self::linkOrButton($edit_link, __('Edit'))
@@ -1307,7 +1311,8 @@ class Util
//Clean up the end of the PHP
if (! empty($GLOBALS['show_as_php'])) {
- $retval .= '\';';
+ $retval .= '\';' . "\n"
+ . '';
}
$retval .= '';
@@ -1333,7 +1338,10 @@ class Util
/**
* TODO: Should we have $cfg['SQLQuery']['InlineEdit']?
*/
- if (! empty($cfg['SQLQuery']['Edit']) && ! $query_too_big) {
+ if (! empty($cfg['SQLQuery']['Edit'])
+ && ! $query_too_big
+ && empty($GLOBALS['show_as_php'])
+ ) {
$inline_edit_link = ' ['
. self::linkOrButton(
'#',
diff --git a/libraries/server_privileges.lib.php b/libraries/server_privileges.lib.php
index 932d7a3d13..0d59e80724 100644
--- a/libraries/server_privileges.lib.php
+++ b/libraries/server_privileges.lib.php
@@ -1032,8 +1032,8 @@ function PMA_getTriggerPrivilegeTable()
'Grant',
'GRANT',
__(
- 'Allows adding users and privileges '
- . 'without reloading the privilege tables.'
+ 'Allows user to give to other users or remove from other users '
+ . 'privileges that user possess on this routine.'
)
),
array(
@@ -1402,16 +1402,16 @@ function PMA_getStructurePrivilegeTable($table, $row)
*/
function PMA_getAdministrationPrivilegeTable($db)
{
- $adminPrivTable = array(
- array('Grant',
- 'GRANT',
- __(
- 'Allows adding users and privileges '
- . 'without reloading the privilege tables.'
- )
- ),
- );
if ($db == '*') {
+ $adminPrivTable = array(
+ array('Grant',
+ 'GRANT',
+ __(
+ 'Allows adding users and privileges '
+ . 'without reloading the privilege tables.'
+ )
+ ),
+ );
$adminPrivTable[] = array('Super',
'SUPER',
__(
@@ -1438,6 +1438,17 @@ function PMA_getAdministrationPrivilegeTable($db)
__('Gives access to the complete list of databases.')
);
}
+ else {
+ $adminPrivTable = array(
+ array('Grant',
+ 'GRANT',
+ __(
+ 'Allows user to give to other users or remove from other'
+ . ' users the privileges that user possess yourself.'
+ )
+ ),
+ );
+ }
$adminPrivTable[] = array('Lock_tables',
'LOCK TABLES',
__('Allows locking tables for the current thread.')
@@ -5153,7 +5164,9 @@ function PMA_addUserAndCreateDatabase($_error, $real_sql_query, $sql_query,
// Grant all privileges on wildcard name (username\_%)
$q = 'GRANT ALL PRIVILEGES ON '
. Util::backquote(
- Util::sqlAddSlashes($username) . '\_%'
+ Util::escapeMysqlWildcards(
+ Util::sqlAddSlashes($username)
+ ) . '\_%'
) . '.* TO \''
. Util::sqlAddSlashes($username)
. '\'@\'' . Util::sqlAddSlashes($hostname) . '\';';
diff --git a/libraries/sql-parser/src/Component.php b/libraries/sql-parser/src/Component.php
index 2e406c5c7b..08720cfa14 100644
--- a/libraries/sql-parser/src/Component.php
+++ b/libraries/sql-parser/src/Component.php
@@ -20,8 +20,7 @@ require_once 'common.php';
*
* @category Components
* @package SqlParser
- * @author Dan Ungureanu