Sanitize pdf link urls.

This commit is contained in:
Brendan Dahl 2012-03-12 12:00:30 -07:00
parent d4111ed025
commit 387a56fd2c

View File

@ -338,7 +338,13 @@ var Page = (function PageClosure() {
if (a) {
switch (a.get('S').name) {
case 'URI':
item.url = a.get('URI');
var url = a.get('URI');
// TODO: pdf spec mentions urls can be relative to a Base
// entry in the dictionary.
// For now only allow http and https schemes.
if (url.search(/^https?\:/) !== 0)
url = '';
item.url = url;
break;
case 'GoTo':
item.dest = a.get('D');