Don't ask for confirmation of query that will not be executed (bug #783667).
This commit is contained in:
@@ -7,6 +7,8 @@ $Source$
|
|||||||
|
|
||||||
2003-08-12 Michal Cihar <nijel@users.sourceforge.net>
|
2003-08-12 Michal Cihar <nijel@users.sourceforge.net>
|
||||||
* libraries/export/csv.php3: Don't trim resulting line (bug #782483).
|
* libraries/export/csv.php3: Don't trim resulting line (bug #782483).
|
||||||
|
* libraries/functions.js: Don't ask for confirmation of query that will
|
||||||
|
not be executed (bug #783667).
|
||||||
|
|
||||||
2003-08-11 Michal Cihar <nijel@users.sourceforge.net>
|
2003-08-11 Michal Cihar <nijel@users.sourceforge.net>
|
||||||
* libraries/export/csv.php3, libraries/export/latex.php3,
|
* libraries/export/csv.php3, libraries/export/latex.php3,
|
||||||
|
@@ -137,24 +137,30 @@ function checkSqlQuery(theForm)
|
|||||||
// js1.2+ -> validation with regular expressions
|
// js1.2+ -> validation with regular expressions
|
||||||
else {
|
else {
|
||||||
var space_re = new RegExp('\\s+');
|
var space_re = new RegExp('\\s+');
|
||||||
isEmpty = (sqlQuery.value.replace(space_re, '') == '') ? 1 : 0;
|
if (typeof(theForm.elements['sql_file']) != 'undefined' &&
|
||||||
|
theForm.elements['sql_file'].value.replace(space_re, '') != '') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (typeof(theForm.elements['sql_localfile']) != 'undefined' &&
|
||||||
|
theForm.elements['sql_localfile'].value.replace(space_re, '') != '') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (isEmpty && typeof(theForm.elements['id_bookmark']) != 'undefined' &&
|
||||||
|
(theForm.elements['id_bookmark'].value != null || theForm.elements['id_bookmark'].value != '') &&
|
||||||
|
theForm.elements['id_bookmark'].selectedIndex != 0
|
||||||
|
) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// Checks for "DROP/DELETE/ALTER" statements
|
// Checks for "DROP/DELETE/ALTER" statements
|
||||||
if (!isEmpty && !confirmQuery(theForm, sqlQuery)) {
|
if (sqlQuery.value.replace(space_re, '') != '') {
|
||||||
return false;
|
if (confirmQuery(theForm, sqlQuery)) {
|
||||||
}
|
return true;
|
||||||
if (isEmpty && typeof(theForm.elements['sql_file']) != 'undefined') {
|
} else {
|
||||||
isEmpty = (theForm.elements['sql_file'].value.replace(space_re, '') == '') ? 1 : 0;
|
return false;
|
||||||
}
|
}
|
||||||
if (isEmpty && typeof(theForm.elements['sql_localfile']) != 'undefined') {
|
|
||||||
isEmpty = (theForm.elements['sql_localfile'].value.replace(space_re, '') == '') ? 1 : 0;
|
|
||||||
}
|
|
||||||
if (isEmpty && typeof(theForm.elements['id_bookmark']) != 'undefined') {
|
|
||||||
isEmpty = (theForm.elements['id_bookmark'].value == null || theForm.elements['id_bookmark'].value == '');
|
|
||||||
isEmpty = (theForm.elements['id_bookmark'].selectedIndex == 0);
|
|
||||||
}
|
|
||||||
if (isEmpty) {
|
|
||||||
theForm.reset();
|
|
||||||
}
|
}
|
||||||
|
theForm.reset();
|
||||||
|
isEmpty = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEmpty) {
|
if (isEmpty) {
|
||||||
|
Reference in New Issue
Block a user