- Fix: Misspelling for dropXMLInternalSubset method (also fixes

use in imagelib when defaulting to image's title)
- Fix: Redirect paths for imagelib redirect checks
This commit is contained in:
Brett Zamir
2020-01-04 17:32:19 +08:00
parent e0ceec2a38
commit 0029a932b2
5 changed files with 12 additions and 9 deletions

View File

@@ -104,12 +104,12 @@ export const init = function (editorContext) {
/**
* Used to prevent the [Billion laughs attack]{@link https://en.wikipedia.org/wiki/Billion_laughs_attack}.
* @function module:utilities.dropXMLInteralSubset
* @function module:utilities.dropXMLInternalSubset
* @param {string} str String to be processed
* @returns {string} The string with entity declarations in the internal subset removed
* @todo This might be needed in other places `parseFromString` is used even without LGTM flagging
*/
export const dropXMLInteralSubset = (str) => {
export const dropXMLInternalSubset = (str) => {
return str.replace(/(<!DOCTYPE\s+\w*\s*\[).*(\?]>)/, '$1$2');
// return str.replace(/(?<doctypeOpen><!DOCTYPE\s+\w*\s*\[).*(?<doctypeClose>\?\]>)/, '$<doctypeOpen>$<doctypeClose>');
};