Pārlūkot izejas kodu

FOP-916: URL in basic-link is scrambled by encryption

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1751621 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-2_2
Simon Steiner pirms 8 gadiem
vecāks
revīzija
02b005d2d3
1 mainītis faili ar 10 papildinājumiem un 1 dzēšanām
  1. 10
    1
      fop-core/src/main/java/org/apache/fop/pdf/PDFUri.java

+ 10
- 1
fop-core/src/main/java/org/apache/fop/pdf/PDFUri.java Parādīt failu

@@ -49,7 +49,7 @@ public class PDFUri extends PDFAction {
}

private String getDictString() {
return "<< /URI (" + encodeString(uri) + ")\n/S /URI >>";
return "<< /URI " + encodeURI(uri) + "\n/S /URI >>";
}

/** {@inheritDoc} */
@@ -58,4 +58,13 @@ public class PDFUri extends PDFAction {
return getDictString();
}

private String encodeURI(String text) {
if (getDocument() != null && getDocumentSafely().isEncryptionActive()) {
final byte[] buf = PDFText.encode(text);
byte[] enc = getDocument().getEncryption().encrypt(buf, this);
return PDFText.toHex(enc, true);
} else {
return "(" + text + ")";
}
}
}

Notiek ielāde…
Atcelt
Saglabāt