fixes mm-1245 filenames are now url escaped

This commit is contained in:
JoramWilander
2015-06-15 11:51:10 -04:00
parent b7a821c341
commit adceb8c929
2 changed files with 2 additions and 2 deletions

View File

@@ -114,7 +114,7 @@ func uploadFile(c *Context, w http.ResponseWriter, r *http.Request) {
return
}
fileUrl := c.TeamUrl + "/api/v1/files/get/" + channelId + "/" + c.Session.UserId + "/" + uid + "/" + files[i].Filename
fileUrl := c.TeamUrl + "/api/v1/files/get/" + channelId + "/" + c.Session.UserId + "/" + uid + "/" + url.QueryEscape(files[i].Filename)
resStruct.Filenames = append(resStruct.Filenames, fileUrl)
}

View File

@@ -165,7 +165,7 @@ module.exports = React.createClass({
<span className="text"> | </span>
</div>
: "" }
<a href={this.props.filenames[id]} download={name} className="text">Download</a>
<a href={this.props.filenames[id]} download={decodeURIComponent(name)} className="text">Download</a>
</div>
</div>
{loading}