summaryrefslogtreecommitdiffstats
path: root/web/react/components/post_body.jsx
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-07-21 12:31:32 -0800
committerCorey Hulen <corey@hulen.com>2015-07-21 12:31:32 -0800
commit1de50f0e4fd8b6a36e29af66375f9db592ce5774 (patch)
tree1799709f9eda102a9a4505568b4a3faa917afa52 /web/react/components/post_body.jsx
parentbee26e3f2654ce7acce647818847480569236343 (diff)
parentf5837c1b64994a15537a0b8df109bed504d0d20a (diff)
downloadchat-1de50f0e4fd8b6a36e29af66375f9db592ce5774.tar.gz
chat-1de50f0e4fd8b6a36e29af66375f9db592ce5774.tar.bz2
chat-1de50f0e4fd8b6a36e29af66375f9db592ce5774.zip
Merge pull request #221 from mattermost/files-patch
Patch for issue with old uploaded files.
Diffstat (limited to 'web/react/components/post_body.jsx')
-rw-r--r--web/react/components/post_body.jsx12
1 files changed, 12 insertions, 0 deletions
diff --git a/web/react/components/post_body.jsx b/web/react/components/post_body.jsx
index d9678df30..96b441c0e 100644
--- a/web/react/components/post_body.jsx
+++ b/web/react/components/post_body.jsx
@@ -28,6 +28,12 @@ module.exports = React.createClass({
var type = utils.getFileType(fileInfo.ext);
+ // This is a temporary patch to fix issue with old files using absolute paths
+ if (fileInfo.path.indexOf("/api/v1/files/get") == -1) {
+ fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
+ }
+ fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
+
if (type === "image") {
$('<img/>').attr('src', fileInfo.path+'_thumb.jpg').load(function(path, name){ return function() {
$(this).remove();
@@ -102,6 +108,12 @@ module.exports = React.createClass({
var type = utils.getFileType(fileInfo.ext);
+ // This is a temporary patch to fix issue with old files using absolute paths
+ if (fileInfo.path.indexOf("/api/v1/files/get") == -1) {
+ fileInfo.path = fileInfo.path.split("/api/v1/files/get")[1];
+ }
+ fileInfo.path = window.location.origin + "/api/v1/files/get" + fileInfo.path;
+
if (type === "image") {
if (i < Constants.MAX_DISPLAY_FILES) {
postFiles.push(