fix: encode URLs
This commit is contained in:
parent
04643c1f6a
commit
5b7a409dd1
3 changed files with 6 additions and 6 deletions
|
@ -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()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue