diff --git a/code/File/File.js b/code/File/File.js index f701585d..f8247a57 100644 --- a/code/File/File.js +++ b/code/File/File.js @@ -313,7 +313,7 @@ File.prototype.update = function(data) { * */ File.prototype.url_macro = function() { - return res.write(this.url || this.getUrl()); + return res.write(encodeURI(this.url || this.getUrl())); } /** diff --git a/code/Image/Image.js b/code/Image/Image.js index 97395804..1605acba 100644 --- a/code/Image/Image.js +++ b/code/Image/Image.js @@ -347,7 +347,7 @@ Image.prototype.contentLength_macro = function() { * */ Image.prototype.url_macro = function() { - return res.write(this.getUrl()); + return res.write(encodeURI(this.getUrl())); } /** @@ -369,7 +369,7 @@ Image.prototype.thumbnail_macro = function(param) { if (!this.thumbnailName) { return this.render_macro(param); } - param.src = this.getUrl(this.getThumbnailFile().getName()); + param.src = encodeURI(this.getUrl(this.getThumbnailFile().getName())); param.title || (param.title = encode(this.description)); param.alt = encode(param.alt || param.title); var width = param.width || this.thumbnailWidth; @@ -391,7 +391,7 @@ Image.prototype.thumbnail_macro = function(param) { * @param {Object} param */ Image.prototype.render_macro = function(param) { - param.src = this.getUrl(); + param.src = encodeURI(this.getUrl()); param.title || (param.title = encode(this.description)); param.alt = encode(param.alt || param.title); var style = []; diff --git a/code/Site/Site.js b/code/Site/Site.js index 6479a6c1..f4ba3ffe 100644 --- a/code/Site/Site.js +++ b/code/Site/Site.js @@ -560,7 +560,7 @@ Site.prototype.renderPage = function (parts) { property: 'og:image', name: 'twitter:image', itemprop: 'image', - content: url + content: encodeURI(url) }); }).join('\n'); } @@ -568,7 +568,7 @@ Site.prototype.renderPage = function (parts) { res.data.videos = parts.videos.map(function (url) { return html.tagAsString('meta', { property: 'og:video', - content: url + content: encodeURI(url) }); }).join('\n'); }