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

Commit

Permalink
Added encodeURIComponent() on the file path url
Browse files Browse the repository at this point in the history
base64_encode() produces "+" that php will treat as whitespace when decoded into $_GET, then base64_decode() fails. i encounterd this when file names contains multibyte characters.
  • Loading branch information
lkho committed Jun 3, 2014
1 parent 102018e commit fb909bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/src/plugins/editor.soundmanager/class.SMPlayer.js
Expand Up @@ -123,7 +123,7 @@ function hookToFilesList(){
$A(fList.getItems()).each(function(row){
if(!row.ajxpNode || (row.ajxpNode.getAjxpMime() != "mp3" && row.ajxpNode.getAjxpMime() != "wav")) return;
addVolumeButton();
var url = ajxpBootstrap.parameters.get('ajxpServerAccess')+'&get_action=audio_proxy&file=base64encoded:'+base64_encode(row.ajxpNode.getPath())+ '&fake=extension.'+row.ajxpNode.getAjxpMime();
var url = ajxpBootstrap.parameters.get('ajxpServerAccess')+'&get_action=audio_proxy&file=base64encoded:'+encodeURIComponent(base64_encode(row.ajxpNode.getPath()))+ '&fake=extension.'+row.ajxpNode.getAjxpMime();
var player = new Element("div", {className:"ui360 ui360-micro"}).update(new Element("a", {href:url}).update(""));
row.down("span#ajxp_label").setStyle({backgroundImage:'none'}).insert({top:player});
threeSixtyPlayer.config.items = [player];
Expand Down Expand Up @@ -246,7 +246,7 @@ soundManager.setup({\n\
return im;
}
addVolumeButton();
var url = ajxpBootstrap.parameters.get('ajxpServerAccess')+'&get_action=audio_proxy&file=base64encoded:'+base64_encode(ajxpNode.getPath());
var url = ajxpBootstrap.parameters.get('ajxpServerAccess')+'&get_action=audio_proxy&file=base64encoded:'+encodeURIComponent(base64_encode(ajxpNode.getPath()));
if(rich){
url += '&rich_preview=true&fake=extension.'+ajxpNode.getAjxpMime();
}else{
Expand Down Expand Up @@ -318,4 +318,4 @@ soundManager.setup({\n\

}

});
});

0 comments on commit fb909bb

Please sign in to comment.