sanitize-html 1.22.0 → 1.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
1.22.1: Increases the patch version of `lodash.mergewith` to enforce an audit fix.
|
|
4
|
+
|
|
3
5
|
1.22.0: bumped `htmlparser2` dependency to the 4.x series. This fixes longstanding bugs and should cause no bc breaks for this module, since the only bc breaks upstream are in regard to features we don't expose in this module.
|
|
4
6
|
|
|
5
7
|
1.21.1: fixed issue with bad `main` setting in package.json that broke 1.21.0.
|
|
@@ -83,7 +85,7 @@ Please note that running `sanitize-html` in the browser is usually a security ho
|
|
|
83
85
|
|
|
84
86
|
1.14.2: protocol-relative URL detection must spot URLs starting with `\\` rather than `//` due to ages-old tolerance features of web browsers, intended for sleepy Windows developers. Thanks to Martin Bajanik.
|
|
85
87
|
|
|
86
|
-
1.14.1: documented `allowProtocolRelative` option. No code changes from 1.14.0, released a few moments ago.
|
|
88
|
+
1.14.1: documented `allowProtocolRelative` option. No code changes from 1.14.0, released a few moments ago.
|
|
87
89
|
|
|
88
90
|
1.14.0: the new `allowProtocolRelative` option, which is set to `true` by default, allows you to decline to accept URLs that start with `//` and thus point to a different host using the current protocol. If you do **not** want to permit this, set this option to `false`. This is fully backwards compatible because the default behavior is to allow them. Thanks to Luke Bernard.
|
|
89
91
|
|
|
@@ -300,6 +300,12 @@ function from (value, encodingOrOffset, length) {
|
|
|
300
300
|
return fromArrayBuffer(value, encodingOrOffset, length)
|
|
301
301
|
}
|
|
302
302
|
|
|
303
|
+
if (typeof SharedArrayBuffer !== 'undefined' &&
|
|
304
|
+
(isInstance(value, SharedArrayBuffer) ||
|
|
305
|
+
(value && isInstance(value.buffer, SharedArrayBuffer)))) {
|
|
306
|
+
return fromArrayBuffer(value, encodingOrOffset, length)
|
|
307
|
+
}
|
|
308
|
+
|
|
303
309
|
if (typeof value === 'number') {
|
|
304
310
|
throw new TypeError(
|
|
305
311
|
'The "value" argument must not be of type number. Received type number'
|
package/dist/sanitize-html.js
CHANGED
|
@@ -39,7 +39,7 @@ var buf=new Uint8Array(length);Object.setPrototypeOf(buf,Buffer.prototype);retur
|
|
|
39
39
|
*/function Buffer(arg,encodingOrOffset,length){// Common case.
|
|
40
40
|
if(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The "string" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
|
|
41
41
|
if(typeof Symbol!=='undefined'&&Symbol.species!=null&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false});}Buffer.poolSize=8192;// not used by this implementation
|
|
42
|
-
function from(value,encodingOrOffset,length){if(typeof value==='string'){return fromString(value,encodingOrOffset);}if(ArrayBuffer.isView(value)){return fromArrayLike(value);}if(value==null){throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, '+'or Array-like Object. Received type '+_typeof(value));}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length);}if(typeof value==='number'){throw new TypeError('The "value" argument must not be of type number. Received type number');}var valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length);}var b=fromObject(value);if(b)return b;if(typeof Symbol!=='undefined'&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==='function'){return Buffer.from(value[Symbol.toPrimitive]('string'),encodingOrOffset,length);}throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, '+'or Array-like Object. Received type '+_typeof(value));}/**
|
|
42
|
+
function from(value,encodingOrOffset,length){if(typeof value==='string'){return fromString(value,encodingOrOffset);}if(ArrayBuffer.isView(value)){return fromArrayLike(value);}if(value==null){throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, '+'or Array-like Object. Received type '+_typeof(value));}if(isInstance(value,ArrayBuffer)||value&&isInstance(value.buffer,ArrayBuffer)){return fromArrayBuffer(value,encodingOrOffset,length);}if(typeof SharedArrayBuffer!=='undefined'&&(isInstance(value,SharedArrayBuffer)||value&&isInstance(value.buffer,SharedArrayBuffer))){return fromArrayBuffer(value,encodingOrOffset,length);}if(typeof value==='number'){throw new TypeError('The "value" argument must not be of type number. Received type number');}var valueOf=value.valueOf&&value.valueOf();if(valueOf!=null&&valueOf!==value){return Buffer.from(valueOf,encodingOrOffset,length);}var b=fromObject(value);if(b)return b;if(typeof Symbol!=='undefined'&&Symbol.toPrimitive!=null&&typeof value[Symbol.toPrimitive]==='function'){return Buffer.from(value[Symbol.toPrimitive]('string'),encodingOrOffset,length);}throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, '+'or Array-like Object. Received type '+_typeof(value));}/**
|
|
43
43
|
* Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
|
|
44
44
|
* if value is a number.
|
|
45
45
|
* Buffer.from(str[, encoding])
|