mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-09-14 14:59:29 -05:00
Rewrite protocol-relative images to http: if necessary
This makes protocol-relative images in sanitized HTML work in testclient, by manually setting the protocol to http:
This commit is contained in:
@@ -645,6 +645,11 @@ var Tools = {
|
||||
srcIdx = i;
|
||||
dataUri = attribs[i + 1];
|
||||
}
|
||||
if (attribs[i] === 'src' && attribs[i + 1].substr(0, 2) === '//') {
|
||||
if (location.protocol !== 'http:' && location.protocol !== 'https:') {
|
||||
attribs[i + 1] = 'http:' + attribs[i + 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
attribs = html.sanitizeAttribs(tagName, attribs, uriRewriter);
|
||||
|
||||
Reference in New Issue
Block a user