From 0306e2bd887454fa4e200142416ea4dea2adbfd1 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Fri, 13 Jun 2014 11:20:27 +0530 Subject: [PATCH] Fix bug#4450 Query is duplicated on Ctrl+Enter Signed-off-by: Atul Pratap Singh --- js/functions.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/js/functions.js b/js/functions.js index 3a5e42ff84..6dc19e72ea 100644 --- a/js/functions.js +++ b/js/functions.js @@ -387,13 +387,13 @@ function confirmQuery(theForm1, sqlQuery1) */ function checkSqlQuery(theForm) { + var sqlQuery; // get the textarea element containing the query if (codemirror_editor) { codemirror_editor.save(); - var sqlQuery = codemirror_editor.display.input; - sqlQuery.value = codemirror_editor.getValue(); + sqlQuery = codemirror_editor.getValue(); } else { - var sqlQuery = theForm.elements['sql_query']; + sqlQuery = theForm.elements.sql_query.value; } var isEmpty = 1; var space_re = new RegExp('\\s+'); @@ -411,7 +411,7 @@ function checkSqlQuery(theForm) return true; } // Checks for "DROP/DELETE/ALTER" statements - if (sqlQuery.value.replace(space_re, '') !== '') { + if (sqlQuery.replace(space_re, '') !== '') { if (confirmQuery(theForm, sqlQuery)) { return true; } else {