rem: var do_confirm_re_0 = new RegExp('^DROP\\s+(IF EXISTS\\s+)?(TABLE|DATABASE)\\s', 'i'); var do_confirm_re_1 = new RegExp('^ALTER\\s+TABLE\\s+((`[^`]+`)|([A-Za-z0-9_$]+))\\s+DROP\\s', 'i'); var do_confirm_re_2 = new RegExp('^DELETE\\s+FROM\\s', 'i'); 
add: var do_confirm_re_0 = new RegExp('^\\s*DROP\\s+(IF EXISTS\\s+)?(TABLE|DATABASE)\\s', 'i'); var do_confirm_re_1 = new RegExp('^\\s*ALTER\\s+TABLE\\s+((`[^`]+`)|([A-Za-z0-9_$]+))\\s+DROP\\s', 'i'); var do_confirm_re_2 = new RegExp('^\\s*DELETE\\s+FROM\\s', 'i'); 
context: function confirmQuery(theForm1, sqlQuery1){    // Confirmation is not required in the configuration file    if (confirmMsg == '') {        return true;    }    // The replace function (js1.2) isn't supported    else if (typeof(sqlQuery1.value.replace) == 'undefined') {        return true;    }    // js1.2+ -> validation with regular expressions    else {        // "DROP DATABASE" statement isn't allowed        if (noDropDbMsg != '') {            var drop_re = new RegExp('(^|;)\\s*DROP\\s+(IF EXISTS\\s+)?DATABASE\\s', 'i');            if (drop_re.test(sqlQuery1.value)) {                alert(noDropDbMsg);                theForm1.reset();                sqlQuery1.focus();                return false;            } // end if        } // end if        // Confirms a "DROP/DELETE/ALTER" statement        //        // TODO: find a way (if possible) to use the parser-analyser        // for this kind of verification        // For now, I just added a ^ to check for the statement at        // beginning of expression        var do_confirm_re_0 = new RegExp('^DROP\\s+(IF EXISTS\\s+)?(TABLE|DATABASE)\\s', 'i');        var do_confirm_re_1 = new RegExp('^ALTER\\s+TABLE\\s+((`[^`]+`)|([A-Za-z0-9_$]+))\\s+DROP\\s', 'i');        var do_confirm_re_2 = new RegExp('^DELETE\\s+FROM\\s', 'i');        if (do_confirm_re_0.test(sqlQuery1.value)            || do_confirm_re_1.test(sqlQuery1.value)            || do_confirm_re_2.test(sqlQuery1.value)) {            var message      = (sqlQuery1.value.length > 100)                             ? sqlQuery1.value.substr(0, 100) + '\n    ...'                             : sqlQuery1.value;            var is_confirmed = confirm(confirmMsg + ' :\n' + message);            // drop/delete/alter statement is confirmed -> update the            // "is_js_confirmed" form field so the confirm test won't be            // run on the server side and allows to submit the form            if (is_confirmed) {                theForm1.elements['is_js_confirmed'].value = 1;                return true;            }            // "DROP/DELETE/ALTER" statement is rejected -> do not submit            // the form            else {                window.focus();                sqlQuery1.focus();                return false;            } // end if (handle confirm box result)        } // end if (display confirm box)    } // end confirmation stuff    return true;} // end of the 'confirmQuery()' function
meta: 5450	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/5450/849bffdfebc559eb37d74f93b5afa16da0d15410/functions.js/clean/js/functions.js