mozilla/pdf.js — pull request #4163 by Rob--W (2014-01-22 12:06:27+00:00)
Title: Recover from bad URI values

This PR fixes issue #4159.

The PDF file in #4159 is malformed:
```
BAD (testo.pdf):
<< /S /URI /URI /v#2findex.php#2fFile:Logo.png >>
GOOD (practice.pdf):
<< /S /URI /URI (http://127.0.0.1/v/index.php/File:Logo.png >>
```

The URL should be wrapped in parentheses, but it isn't. Consequently, the blob is interpreted as a Name (because of the leading "/"), and the resulting object is `{name: "v/index.php/File:Logo.png" }`. Obviously, this is not a string, so `url.indexOf` throws an error here.

I have also adjusted the URL parsing code to make it RFC 3986-compliant, to avoid mis-interpreting "/v/index.php/File:Logo.png" as an invalid URL. Now the validation function returns true if relative URLs are accepted.