1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Strip null (\x00) characters from the URLs in LinkAnnotations (issue 6832)

Apparently some PDF files can have annotations with `URI` entries ending with `null` characters, thus breaking the links.
To handle this edge-case of bad PDFs, this patch moves the already existing utility function from `ui_utils.js` into `util.js`, in order to fix those URLs.

Fixes 6832.
This commit is contained in:
Jonas Jenwald 2016-01-04 21:33:41 +01:00
parent 4e9ea35eee
commit 97c10e9c08
7 changed files with 33 additions and 25 deletions

View file

@ -23,12 +23,6 @@ var MAX_AUTO_SCALE = 1.25;
var SCROLLBAR_PADDING = 40;
var VERTICAL_PADDING = 5;
var NullCharactersRegExp = /\x00/g;
function removeNullCharacters(str) {
return str.replace(NullCharactersRegExp, '');
}
function getFileName(url) {
var anchor = url.indexOf('#');
var query = url.indexOf('?');