diff --git a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js index ff2504c..2fb0c52 100755 --- a/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js +++ b/web/pgadmin/misc/file_manager/templates/file_manager/js/utility.js @@ -14,7 +14,8 @@ // use alertify and underscore js var alertify = require("alertify"), - _ = require("underscore"); + _ = require("underscore"), + S = require("underscore.string"); /*--------------------------------------------------------- Define functions used for various operations @@ -173,7 +174,7 @@ var setUploader = function(path) { $('.storage_dialog #uploader .input-path').val(path); } } else if (!config.options.platform_type === "win32" && - (path == '' || !path.startsWith('/'))) { + (path == '' || !S.startsWith(path, '/'))) { path = '/' + path; $('.storage_dialog #uploader .input-path').val(path); } else { @@ -1488,7 +1489,7 @@ function InputObject() { path = path.replace(/\//g, '\\') } else { path = path.replace(/\\/g, '/') - if (!path.startsWith('/')) { + if (!S.startsWith(path, '/')) { path = '/' + path; } } diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js index f9d4f15..2062aa2 100644 --- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js @@ -3089,8 +3089,10 @@ define( $("#btn-flash").prop('disabled', true); - if (explain_prefix != undefined && !sql.trim().toUpperCase().startsWith("EXPLAIN")) + if (explain_prefix != undefined && + !S.startsWith(sql.trim().toUpperCase(), "EXPLAIN")) { sql = explain_prefix + ' ' + sql; + } self.query_start_time = new Date(); self.query = sql;