Patch applied, thanks.
I don’t think empty is a valid value, though ‘/’ should be equivalent.
Nathan
Hi,
currently, you must specify a non-empty URL where egroupware is installed.
Therefore you cannot install egroupware at root (there are workarounds but
they impose other problems e.g. if your server is multi-homed). If you still
try, various things don’t work, e.g. translations are missing sometimes.
Digging into the sources, I tracked this bug down to commit #46252. More
specifically, strip_egw_url() of egw_files.js converts absolute to relative
URLs. It assumes that the base url (egw.webserverUrl) is a unique substring
inside that URL. This doesn’t hold true if
- that base URL is empty
- the base URL is too “generic” (e.g. “/js”)
Further, protocol detection never worked (see “var need_full_url…” in
patch). This leads to potential duplicate loading of files.
I propose the following patch, but IMHO the entire logic of this function
should be rewritten to make it really safe.:
— egw_files.js.orig 2015-03-10 17:11:20.000000000 +0100
+++ egw_files.js 2015-03-13 10:44:40.996000000 +0100
@@ -90,9 +90,13 @@
var file = _urls[i];
// check if egw_url is only path and urls contains full url incl. protocol
// --> prefix it with our protocol and host, as eg. splitting by just '/'
will fail!
- var need_full_url = egw_url[0] == ‘/’ && file.substr(4) == ‘http’ ?
window.location.protocol+’://’+window.location.host : ‘’;
- var parts = file.split(need_full_url+egw_url,2);
- if (parts.length == 2) _urls[i] = parts[1];
- var need_full_url = egw_url[0] == ‘/’ && file.substr(0,4) == ‘http’ ?
window.location.protocol+’//’+window.location.host : ‘’;
- var parts = file.split(need_full_url+egw_url);
- if (parts.length > 1) {
- // discard protocol and host
- parts.shift();
- _urls[i] = parts.join(need_full_url+egw_url);
- }
}
return _urls;
}
I would be happy if you could commit that (or something better) to the code
base.
Thank you,
Thomas Kurschel
Dive into the World of Parallel Programming The Go Parallel Website,
sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for
all
things parallel software development, from weekly thought leadership blogs
to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
eGroupWare-developers mailing list
eGroupWare-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-developers