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/).
This commit is contained in:
daze 2016-07-26 12:47:46 +01:00 committed by Dave Page
parent 790b28fb61
commit 19306934a0

View File

@ -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,