From 19306934a08f786cba2cd156a14858e66602038c Mon Sep 17 00:00:00 2001 From: daze Date: Tue, 26 Jul 2016 12:47:46 +0100 Subject: [PATCH] Property 'URL' (of type string) not quoted in browser.js template when extending pgAdmin.Browser. Fixes #1504 Without quotes, the property can be mistakenly treated as a regex: e.g.: URL: /pgadmin/browser/, When that happens, JS engine throws "SyntaxError: invalid regular expression flag b" and the whole web interface freezes. This problem usually occurs when pgadmin is hosted inside a subdirectory (https://host/pgadmin/ instead of https://host/). --- web/pgadmin/browser/templates/browser/js/browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/pgadmin/browser/templates/browser/js/browser.js b/web/pgadmin/browser/templates/browser/js/browser.js index 9464010a7..82bed326e 100644 --- a/web/pgadmin/browser/templates/browser/js/browser.js +++ b/web/pgadmin/browser/templates/browser/js/browser.js @@ -36,7 +36,7 @@ function(require, $, _, S, Bootstrap, pgAdmin, alertify, CodeMirror) { // Extend the browser class attributes _.extend(pgAdmin.Browser, { // The base url for browser - URL: {{ url_for('browser.index') }}, + URL: '{{ url_for('browser.index') }}', // We do have docker of type wcDocker to take care of different // containers. (i.e. panels, tabs, frames, etc.) docker:null,