only run query if we didn't aks to see the phpcode of sql

This commit is contained in:
Mike Beck
2002-07-12 14:57:31 +00:00
parent 6bf0c44168
commit b4728b63df
2 changed files with 12 additions and 7 deletions

View File

@@ -4,7 +4,8 @@ phpMyAdmin - Changelog
$Id$ $Id$
$Source$ $Source$
2002-07-12 Mike Beck <mikebeck@users.sourceforge.net>
* sql.php3: only run query if we didn't ask for phpcode of sql
2002-07-12 Marc Delisle <lem9@users.sourceforge.net> 2002-07-12 Marc Delisle <lem9@users.sourceforge.net>
* libraries/select_lang.lib.php3: add -utf-8 choices * libraries/select_lang.lib.php3: add -utf-8 choices
* lang/indonesian updates, thanks to Rachim Tamsjadi * lang/indonesian updates, thanks to Rachim Tamsjadi
@@ -12,11 +13,11 @@ $Source$
thanks to Jurgen Schwietering (jurgen at schwietering.com) thanks to Jurgen Schwietering (jurgen at schwietering.com)
2002-07-11 Lo<4C>c Chapeaux <lolo@phpheaven.net> 2002-07-11 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* pdf_schema.php3; tbl_printview.php3; tbl_properties_links.php3; * pdf_schema.php3; tbl_printview.php3; tbl_properties_links.php3;
tbl_properties_operations.php3; tbl_relation.php3; tbl_properties_operations.php3; tbl_relation.php3;
libraries/charset_conversion.lib.php3; libraries/display_tbl.lib.php3; libraries/charset_conversion.lib.php3; libraries/display_tbl.lib.php3;
libraries/relation.lib.php3: coding standards. libraries/relation.lib.php3: coding standards.
* libraries/common.lib.php3: coding standards and a little display bug. * libraries/common.lib.php3: coding standards and a little display bug.
2002-07-11 Alexander M. Turek <rabus@users.sourceforge.net> 2002-07-11 Alexander M. Turek <rabus@users.sourceforge.net>
* libraries/common.lib.php3: PHP3 compatibility. * libraries/common.lib.php3: PHP3 compatibility.

View File

@@ -88,6 +88,7 @@ function PMA_sqlFormat($sql_str) {
*/ */
if (!defined('PMA_CHK_DROP') if (!defined('PMA_CHK_DROP')
&& !$cfg['AllowUserDropDatabase'] && !$cfg['AllowUserDropDatabase']
&& eregi('DROP[[:space:]]+(IF EXISTS[[:space:]]+)?DATABASE[[:space:]]', $sql_query)) { && eregi('DROP[[:space:]]+(IF EXISTS[[:space:]]+)?DATABASE[[:space:]]', $sql_query)) {
// Checks if the user is a Superuser // Checks if the user is a Superuser
// TODO: set a global variable with this information // TODO: set a global variable with this information
@@ -326,7 +327,10 @@ else {
} }
// Executes the query // 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 // Displays an error message if required and stop parsing the script
if (PMA_mysql_error()) { if (PMA_mysql_error()) {
$error = PMA_mysql_error(); $error = PMA_mysql_error();