1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-13 18:14:07 +02:00

\r can be part of a query

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1017 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-08-26 11:23:31 +00:00
parent 8a351025e5
commit e75ef01c2c

View File

@@ -9,8 +9,7 @@ page_header(lang('SQL command'), $error);
if (!$error && $_POST) {
$query = ($_POST["webfile"] ? @file_get_contents("adminer.sql") : ($_POST["file"] ? get_file("sql_file") : $_POST["query"]));
if (is_string($query)) { // get_file() returns error as number
$query = str_replace("\r", "", $query); // parser looks for \n
if (is_string($query)) { // get_file() returns error as number, file_get_contents as false
$query = rtrim($query);
if (strlen($query) && (!$history || end($history) != $query)) { // don't add repeated
$history[] = $query;