Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Make sure to handle the "BASE" tag instead of document.location.href,…
Browse files Browse the repository at this point in the history
… should be an util function - Fix 404 for opening images in external window.
  • Loading branch information
cdujeu committed Feb 5, 2014
1 parent 959a87c commit b508219
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions core/src/plugins/editor.browser/class.BrowserOpener.js
Expand Up @@ -33,6 +33,10 @@ Class.create("BrowserOpener", AbstractEditor, {
var loc = document.location.href;
if(loc.indexOf("?") !== -1) loc = loc.substring(0, loc.indexOf("?"));
var url = loc.substring(0, loc.lastIndexOf('/'));
if($$('base').length){
url = $$("base")[0].getAttribute("href");
if(url.substr(-1) == '/') url = url.substr(0, url.length - 1);
}
var nonSecureAccessPath = ajxpServerAccessPath.substring(0, ajxpServerAccessPath.lastIndexOf('?'));
var open_file_url = url + "/" + nonSecureAccessPath + "?get_action=open_file&repository_id=" + repo + "&file=" + encodeURIComponent(node.getPath());

Expand Down
4 changes: 2 additions & 2 deletions core/src/plugins/uploader.jumploader/jumploader_tpl.html
Expand Up @@ -103,8 +103,8 @@
height="400" \
mayscript> \
<param name="gc_loggingLevel" value="ERROR"/> \
<param name="uc_uploadUrl" value="'+ document.location.href.split("?").shift() + '?secure_token=' + parent.Connexion.SECURE_TOKEN +'&get_action=upload"/> \
<param name="uc_resumeCheckUrl" value="'+ document.location.href.split("?").shift() + '?secure_token=' + parent.Connexion.SECURE_TOKEN +'&get_action=upload"/> \
<param name="uc_uploadUrl" value="'+ document.location.href.split("?").shift().replace('index_shared.php', 'index.php') + '?secure_token=' + parent.Connexion.SECURE_TOKEN +'&get_action=upload"/> \
<param name="uc_resumeCheckUrl" value="'+ document.location.href.split("?").shift().replace('index_shared.php', 'index.php') + '?secure_token=' + parent.Connexion.SECURE_TOKEN +'&get_action=upload"/> \
<param name="uc_fileParameterName" value="userfile_0"/> \
<param name="ac_fireUploaderStatusChanged" value="true"/> \
<param name="ac_fireAppletInitialized" value="true"/> \
Expand Down

0 comments on commit b508219

Please sign in to comment.