From dfc787a0b9728fade4692e8de0317eeffc992f38 Mon Sep 17 00:00:00 2001 From: Makarand Bauskar Date: Mon, 28 Dec 2015 12:40:56 +0530 Subject: [PATCH] get_base_url fix if url contains the 'desk' then the get_base_url function was removes the desk from url e.g. if url is www.helpdesk.com/desk then get_base_url() returns http://help instead of http://www.helpdesk.com --- frappe/public/js/legacy/dom.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frappe/public/js/legacy/dom.js b/frappe/public/js/legacy/dom.js index 616be9938f..ab8ef7476e 100644 --- a/frappe/public/js/legacy/dom.js +++ b/frappe/public/js/legacy/dom.js @@ -180,7 +180,8 @@ frappe.urllib = { // returns the base url with http + domain + path (-index.cgi or # or ?) get_base_url: function() { - var url= (frappe.base_url || window.location.href).split('#')[0].split('?')[0].split('desk')[0]; + // var url= (frappe.base_url || window.location.href).split('#')[0].split('?')[0].split('desk')[0]; + var url = (frappe.base_url || window.location.origin) if(url.substr(url.length-1, 1)=='/') url = url.substr(0, url.length-1) return url },