mirror of
https://github.com/openseadragon/openseadragon.git
synced 2024-12-01 09:36:08 +03:00
Wrap URL parameter decoding in try-catch for safety
This commit is contained in:
parent
e46d7c64ae
commit
f7f2f501f5
@ -2586,8 +2586,13 @@ function OpenSeadragon( options ){
|
|||||||
sep = part.indexOf( '=' );
|
sep = part.indexOf( '=' );
|
||||||
|
|
||||||
if ( sep > 0 ) {
|
if ( sep > 0 ) {
|
||||||
URLPARAMS[ part.substring( 0, sep ) ] =
|
var key = part.substring( 0, sep ),
|
||||||
decodeURIComponent( part.substring( sep + 1 ) );
|
value = part.substring( sep + 1 );
|
||||||
|
try {
|
||||||
|
URLPARAMS[ key ] = decodeURIComponent( value );
|
||||||
|
} catch (e) {
|
||||||
|
$.console.error( "Ignoring malformed URL parameter: %s=%s", key, value );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user