diff --git a/app/assets/javascripts/discourse.js b/app/assets/javascripts/discourse.js index da97ad531b0..6a234d3ed68 100644 --- a/app/assets/javascripts/discourse.js +++ b/app/assets/javascripts/discourse.js @@ -33,7 +33,7 @@ window.Discourse = Ember.Application.createWithMixins(Discourse.Ajax, { getURLWithCDN: function(url) { url = this.getURL(url); // https:// and http:// and // should be skipped, only /xyz is allowed here - if (Discourse.CDN && url[1] !== "/") { + if (Discourse.CDN && /^\/[^\/]/.test(url)) { url = Discourse.CDN + url; } else if (Discourse.S3CDN) { url = url.replace(Discourse.S3BaseUrl, Discourse.S3CDN); diff --git a/app/assets/javascripts/discourse/helpers/application_helpers.js b/app/assets/javascripts/discourse/helpers/application_helpers.js index 3eff90d74b1..291e598b143 100644 --- a/app/assets/javascripts/discourse/helpers/application_helpers.js +++ b/app/assets/javascripts/discourse/helpers/application_helpers.js @@ -20,10 +20,7 @@ Em.Handlebars.helper('bound-avatar', function(user, size, uploadId) { * Used when we only have a template */ Em.Handlebars.helper('bound-avatar-template', function(avatarTemplate, size) { - return new safe(Discourse.Utilities.avatarImg({ - size: size, - avatarTemplate: avatarTemplate - })); + return new safe(Discourse.Utilities.avatarImg({ size: size, avatarTemplate: avatarTemplate })); }); registerUnbound('raw-date', function(dt) { diff --git a/app/assets/javascripts/discourse/lib/utilities.js b/app/assets/javascripts/discourse/lib/utilities.js index 0cf09ffffbf..6d08ab93471 100644 --- a/app/assets/javascripts/discourse/lib/utilities.js +++ b/app/assets/javascripts/discourse/lib/utilities.js @@ -44,7 +44,8 @@ Discourse.Utilities = { var classes = "avatar" + (options.extraClasses ? " " + options.extraClasses : ""); var title = (options.title) ? " title='" + Handlebars.Utils.escapeExpression(options.title || "") + "'" : ""; - return ""; + + return ""; }, tinyAvatar: function(avatarTemplate, options) {