Skip to content

Commit c2e3a5f

Browse files
authored
Validate Link HREFs only when they are not templated (#387)
1 parent 43762ef commit c2e3a5f

File tree

6 files changed

+1868
-1014
lines changed

6 files changed

+1868
-1014
lines changed

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,16 @@ carthage-project:
1515

1616
.PHONY: scripts
1717
scripts:
18+
rm -rf "$(SCRIPTS_PATH)/node_modules"
1819
yarn --cwd "$(SCRIPTS_PATH)" install --frozen-lockfile
1920
yarn --cwd "$(SCRIPTS_PATH)" run format
2021
yarn --cwd "$(SCRIPTS_PATH)" run lint
2122
yarn --cwd "$(SCRIPTS_PATH)" run bundle
2223

24+
.PHONY: update-scripts
25+
update-scripts:
26+
yarn --cwd "$(SCRIPTS_PATH)" install
27+
2328
.PHONY: test
2429
test:
2530
# To limit to a particular test suite: -only-testing:R2SharedTests

Sources/Navigator/EPUB/Assets/Static/scripts/readium-fixed.js

Lines changed: 127 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3775,8 +3775,8 @@ if ($defineProperty) {
37753775
}
37763776
}
37773777

3778-
var $SyntaxError = GetIntrinsic('%SyntaxError%');
3779-
var $TypeError = GetIntrinsic('%TypeError%');
3778+
var $SyntaxError = __webpack_require__(/*! es-errors/syntax */ "./node_modules/es-errors/syntax.js");
3779+
var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js");
37803780

37813781
var gopd = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js");
37823782

@@ -3928,7 +3928,7 @@ var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bin
39283928
var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js");
39293929
var setFunctionLength = __webpack_require__(/*! set-function-length */ "./node_modules/set-function-length/index.js");
39303930

3931-
var $TypeError = GetIntrinsic('%TypeError%');
3931+
var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js");
39323932
var $apply = GetIntrinsic('%Function.prototype.apply%');
39333933
var $call = GetIntrinsic('%Function.prototype.call%');
39343934
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
@@ -3968,6 +3968,111 @@ if ($defineProperty) {
39683968
}
39693969

39703970

3971+
/***/ }),
3972+
3973+
/***/ "./node_modules/es-errors/eval.js":
3974+
/*!****************************************!*\
3975+
!*** ./node_modules/es-errors/eval.js ***!
3976+
\****************************************/
3977+
/***/ ((module) => {
3978+
3979+
"use strict";
3980+
3981+
3982+
/** @type {import('./eval')} */
3983+
module.exports = EvalError;
3984+
3985+
3986+
/***/ }),
3987+
3988+
/***/ "./node_modules/es-errors/index.js":
3989+
/*!*****************************************!*\
3990+
!*** ./node_modules/es-errors/index.js ***!
3991+
\*****************************************/
3992+
/***/ ((module) => {
3993+
3994+
"use strict";
3995+
3996+
3997+
/** @type {import('.')} */
3998+
module.exports = Error;
3999+
4000+
4001+
/***/ }),
4002+
4003+
/***/ "./node_modules/es-errors/range.js":
4004+
/*!*****************************************!*\
4005+
!*** ./node_modules/es-errors/range.js ***!
4006+
\*****************************************/
4007+
/***/ ((module) => {
4008+
4009+
"use strict";
4010+
4011+
4012+
/** @type {import('./range')} */
4013+
module.exports = RangeError;
4014+
4015+
4016+
/***/ }),
4017+
4018+
/***/ "./node_modules/es-errors/ref.js":
4019+
/*!***************************************!*\
4020+
!*** ./node_modules/es-errors/ref.js ***!
4021+
\***************************************/
4022+
/***/ ((module) => {
4023+
4024+
"use strict";
4025+
4026+
4027+
/** @type {import('./ref')} */
4028+
module.exports = ReferenceError;
4029+
4030+
4031+
/***/ }),
4032+
4033+
/***/ "./node_modules/es-errors/syntax.js":
4034+
/*!******************************************!*\
4035+
!*** ./node_modules/es-errors/syntax.js ***!
4036+
\******************************************/
4037+
/***/ ((module) => {
4038+
4039+
"use strict";
4040+
4041+
4042+
/** @type {import('./syntax')} */
4043+
module.exports = SyntaxError;
4044+
4045+
4046+
/***/ }),
4047+
4048+
/***/ "./node_modules/es-errors/type.js":
4049+
/*!****************************************!*\
4050+
!*** ./node_modules/es-errors/type.js ***!
4051+
\****************************************/
4052+
/***/ ((module) => {
4053+
4054+
"use strict";
4055+
4056+
4057+
/** @type {import('./type')} */
4058+
module.exports = TypeError;
4059+
4060+
4061+
/***/ }),
4062+
4063+
/***/ "./node_modules/es-errors/uri.js":
4064+
/*!***************************************!*\
4065+
!*** ./node_modules/es-errors/uri.js ***!
4066+
\***************************************/
4067+
/***/ ((module) => {
4068+
4069+
"use strict";
4070+
4071+
4072+
/** @type {import('./uri')} */
4073+
module.exports = URIError;
4074+
4075+
39714076
/***/ }),
39724077

39734078
/***/ "./node_modules/es-set-tostringtag/index.js":
@@ -4273,9 +4378,15 @@ module.exports = functionsHaveNames;
42734378

42744379
var undefined;
42754380

4276-
var $SyntaxError = SyntaxError;
4381+
var $Error = __webpack_require__(/*! es-errors */ "./node_modules/es-errors/index.js");
4382+
var $EvalError = __webpack_require__(/*! es-errors/eval */ "./node_modules/es-errors/eval.js");
4383+
var $RangeError = __webpack_require__(/*! es-errors/range */ "./node_modules/es-errors/range.js");
4384+
var $ReferenceError = __webpack_require__(/*! es-errors/ref */ "./node_modules/es-errors/ref.js");
4385+
var $SyntaxError = __webpack_require__(/*! es-errors/syntax */ "./node_modules/es-errors/syntax.js");
4386+
var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js");
4387+
var $URIError = __webpack_require__(/*! es-errors/uri */ "./node_modules/es-errors/uri.js");
4388+
42774389
var $Function = Function;
4278-
var $TypeError = TypeError;
42794390

42804391
// eslint-disable-next-line consistent-return
42814392
var getEvalledConstructor = function (expressionSyntax) {
@@ -4327,6 +4438,7 @@ var needsEval = {};
43274438
var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);
43284439

43294440
var INTRINSICS = {
4441+
__proto__: null,
43304442
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
43314443
'%Array%': Array,
43324444
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
@@ -4347,9 +4459,9 @@ var INTRINSICS = {
43474459
'%decodeURIComponent%': decodeURIComponent,
43484460
'%encodeURI%': encodeURI,
43494461
'%encodeURIComponent%': encodeURIComponent,
4350-
'%Error%': Error,
4462+
'%Error%': $Error,
43514463
'%eval%': eval, // eslint-disable-line no-eval
4352-
'%EvalError%': EvalError,
4464+
'%EvalError%': $EvalError,
43534465
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
43544466
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
43554467
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
@@ -4371,8 +4483,8 @@ var INTRINSICS = {
43714483
'%parseInt%': parseInt,
43724484
'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
43734485
'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
4374-
'%RangeError%': RangeError,
4375-
'%ReferenceError%': ReferenceError,
4486+
'%RangeError%': $RangeError,
4487+
'%ReferenceError%': $ReferenceError,
43764488
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
43774489
'%RegExp%': RegExp,
43784490
'%Set%': typeof Set === 'undefined' ? undefined : Set,
@@ -4389,7 +4501,7 @@ var INTRINSICS = {
43894501
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
43904502
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
43914503
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
4392-
'%URIError%': URIError,
4504+
'%URIError%': $URIError,
43934505
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
43944506
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
43954507
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
@@ -4431,6 +4543,7 @@ var doEval = function doEval(name) {
44314543
};
44324544

44334545
var LEGACY_ALIASES = {
4546+
__proto__: null,
44344547
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
44354548
'%ArrayPrototype%': ['Array', 'prototype'],
44364549
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
@@ -4840,11 +4953,10 @@ module.exports = bind.call(call, $hasOwn);
48404953
"use strict";
48414954

48424955

4843-
var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js");
48444956
var hasOwn = __webpack_require__(/*! hasown */ "./node_modules/hasown/index.js");
48454957
var channel = __webpack_require__(/*! side-channel */ "./node_modules/side-channel/index.js")();
48464958

4847-
var $TypeError = GetIntrinsic('%TypeError%');
4959+
var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js");
48484960

48494961
var SLOT = {
48504962
assert: function (O, slot) {
@@ -6075,11 +6187,10 @@ module.exports = function shimFlags() {
60756187

60766188

60776189
var callBound = __webpack_require__(/*! call-bind/callBound */ "./node_modules/safe-regex-test/node_modules/call-bind/callBound.js");
6078-
var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js");
60796190
var isRegex = __webpack_require__(/*! is-regex */ "./node_modules/is-regex/index.js");
60806191

60816192
var $exec = callBound('RegExp.prototype.exec');
6082-
var $TypeError = GetIntrinsic('%TypeError%');
6193+
var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js");
60836194

60846195
module.exports = function regexTester(regex) {
60856196
if (!isRegex(regex)) {
@@ -6132,7 +6243,7 @@ var bind = __webpack_require__(/*! function-bind */ "./node_modules/function-bin
61326243
var GetIntrinsic = __webpack_require__(/*! get-intrinsic */ "./node_modules/get-intrinsic/index.js");
61336244
var setFunctionLength = __webpack_require__(/*! set-function-length */ "./node_modules/set-function-length/index.js");
61346245

6135-
var $TypeError = GetIntrinsic('%TypeError%');
6246+
var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js");
61366247
var $apply = GetIntrinsic('%Function.prototype.apply%');
61376248
var $call = GetIntrinsic('%Function.prototype.call%');
61386249
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
@@ -6188,7 +6299,7 @@ var define = __webpack_require__(/*! define-data-property */ "./node_modules/def
61886299
var hasDescriptors = __webpack_require__(/*! has-property-descriptors */ "./node_modules/has-property-descriptors/index.js")();
61896300
var gOPD = __webpack_require__(/*! gopd */ "./node_modules/gopd/index.js");
61906301

6191-
var $TypeError = GetIntrinsic('%TypeError%');
6302+
var $TypeError = __webpack_require__(/*! es-errors/type */ "./node_modules/es-errors/type.js");
61926303
var $floor = GetIntrinsic('%Math.floor%');
61936304

61946305
/** @typedef {(...args: unknown[]) => unknown} Func */

0 commit comments

Comments
 (0)