From b4728b63dfaab08efb6533b22bb257be753b5fb6 Mon Sep 17 00:00:00 2001 From: Mike Beck Date: Fri, 12 Jul 2002 14:57:31 +0000 Subject: [PATCH] only run query if we didn't aks to see the phpcode of sql --- ChangeLog | 13 +++++++------ sql.php3 | 6 +++++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61c20356f..b027892c1 100755 --- a/ChangeLog +++ b/ChangeLog @@ -4,7 +4,8 @@ phpMyAdmin - Changelog $Id$ $Source$ - +2002-07-12 Mike Beck + * sql.php3: only run query if we didn't ask for phpcode of sql 2002-07-12 Marc Delisle * libraries/select_lang.lib.php3: add -utf-8 choices * lang/indonesian updates, thanks to Rachim Tamsjadi @@ -12,11 +13,11 @@ $Source$ thanks to Jurgen Schwietering (jurgen at schwietering.com) 2002-07-11 Loïc Chapeaux - * pdf_schema.php3; tbl_printview.php3; tbl_properties_links.php3; - tbl_properties_operations.php3; tbl_relation.php3; - libraries/charset_conversion.lib.php3; libraries/display_tbl.lib.php3; - libraries/relation.lib.php3: coding standards. - * libraries/common.lib.php3: coding standards and a little display bug. + * pdf_schema.php3; tbl_printview.php3; tbl_properties_links.php3; + tbl_properties_operations.php3; tbl_relation.php3; + libraries/charset_conversion.lib.php3; libraries/display_tbl.lib.php3; + libraries/relation.lib.php3: coding standards. + * libraries/common.lib.php3: coding standards and a little display bug. 2002-07-11 Alexander M. Turek * libraries/common.lib.php3: PHP3 compatibility. diff --git a/sql.php3 b/sql.php3 index 4b5f424d9..524579008 100755 --- a/sql.php3 +++ b/sql.php3 @@ -88,6 +88,7 @@ function PMA_sqlFormat($sql_str) { */ if (!defined('PMA_CHK_DROP') && !$cfg['AllowUserDropDatabase'] + && eregi('DROP[[:space:]]+(IF EXISTS[[:space:]]+)?DATABASE[[:space:]]', $sql_query)) { // Checks if the user is a Superuser // TODO: set a global variable with this information @@ -326,7 +327,10 @@ else { } // Executes the query - $result = @PMA_mysql_query($full_sql_query); + // only if we didn't ask to see the php code (mikebeck) + if (empty($GLOBALS['show_as_php'])){ + $result = @PMA_mysql_query($full_sql_query); + } // Displays an error message if required and stop parsing the script if (PMA_mysql_error()) { $error = PMA_mysql_error();