From 98ccf0fd6c548e22849bf2d4a1f48e511eef9c4f Mon Sep 17 00:00:00 2001 From: jakubvrana Date: Tue, 10 Jul 2007 13:51:37 +0000 Subject: [PATCH] File upload on same URL git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@99 7c3ca157-0c34-0410-bff1-cbf682f78f5c --- index.php | 2 +- sql.inc.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/index.php b/index.php index add9ea7c..d355f39a 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ session_start(); error_reporting(E_ALL & ~E_NOTICE); $SELF = preg_replace('~^[^?]*/([^?]*).*~', '\\1?', $_SERVER["REQUEST_URI"]) . (strlen($_GET["server"]) ? 'server=' . urlencode($_GET["server"]) . '&' : '') . (strlen($_GET["db"]) ? 'db=' . urlencode($_GET["db"]) . '&' : ''); -$TOKENS = &$_SESSION["tokens"][$_GET["server"]][preg_replace('~([?&]sql=)upload~', '\\1', $_SERVER["REQUEST_URI"])]; +$TOKENS = &$_SESSION["tokens"][$_GET["server"]][$_SERVER["REQUEST_URI"]]; include "./functions.inc.php"; include "./lang.inc.php"; include "./design.inc.php"; diff --git a/sql.inc.php b/sql.inc.php index f39e3cf0..c2e1f6c6 100644 --- a/sql.inc.php +++ b/sql.inc.php @@ -38,12 +38,12 @@ if ($_POST && $error) { if ($empty) { echo "

" . lang('No commands to execute.') . "

\n"; } -} elseif ($_GET["sql"] == "upload") { +} elseif ($_POST) { echo "

" . lang('Unable to upload a file.') . "

\n"; } ?> -
+

@@ -52,7 +52,7 @@ if ($_POST && $error) { if (!ini_get("file_uploads")) { echo "

" . lang('File uploads are disabled.') . "

\n"; } else { ?> -
+

: