FIX: use CDN URL for audio/video uploads
This commit is contained in:
parent
ffb24bf82d
commit
d2c297955a
|
@ -262,7 +262,7 @@ Discourse.Utilities = {
|
||||||
return '<img src="' + upload.url + '" width="' + upload.width + '" height="' + upload.height + '">';
|
return '<img src="' + upload.url + '" width="' + upload.width + '" height="' + upload.height + '">';
|
||||||
} else if (!Discourse.SiteSettings.prevent_anons_from_downloading_files && (/\.(mov|mp4|webm|ogv|mp3|ogg|wav)$/i).test(upload.original_filename)) {
|
} else if (!Discourse.SiteSettings.prevent_anons_from_downloading_files && (/\.(mov|mp4|webm|ogv|mp3|ogg|wav)$/i).test(upload.original_filename)) {
|
||||||
// is Audio/Video
|
// is Audio/Video
|
||||||
return "http://" + Discourse.BaseUrl + upload.url;
|
return Discourse.CDN ? Discourse.getURLWithCDN(upload.url) : "http://" + Discourse.BaseUrl + upload.url;
|
||||||
} else {
|
} else {
|
||||||
return '<a class="attachment" href="' + upload.url + '">' + upload.original_filename + '</a> (' + I18n.toHumanSize(upload.filesize) + ')';
|
return '<a class="attachment" href="' + upload.url + '">' + upload.original_filename + '</a> (' + I18n.toHumanSize(upload.filesize) + ')';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue