This is an automated email from the ASF dual-hosted git repository.
nick pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tika.git
The following commit(s) were added to refs/heads/master by this push:
new a51add2 Forbidden APIs fix - Use a specified encoding when turning
Strings into Bytes
a51add2 is described below
commit a51add2afe475ba8d3fb5847c97f52b1eb71deea
Author: Nick Burch <[email protected]>
AuthorDate: Sat Jul 29 13:38:00 2017 +0100
Forbidden APIs fix - Use a specified encoding when turning Strings into
Bytes
---
.../apache/tika/parser/microsoft/POIFSContainerDetector.java | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git
a/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/POIFSContainerDetector.java
b/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/POIFSContainerDetector.java
index ff68b8b..1c98690 100644
---
a/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/POIFSContainerDetector.java
+++
b/tika-parsers/src/main/java/org/apache/tika/parser/microsoft/POIFSContainerDetector.java
@@ -21,6 +21,7 @@ import static org.apache.tika.mime.MediaType.application;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -150,24 +151,24 @@ public class POIFSContainerDetector implements Detector {
/**
* An ASCII String "StarImpress"
*/
- private static final byte[] STAR_IMPRESS = "StarImpress".getBytes();
+ private static final byte[] STAR_IMPRESS =
"StarImpress".getBytes(StandardCharsets.US_ASCII);
/**
* An ASCII String "StarDraw"
*/
- private static final byte[] STAR_DRAW = "StarDraw".getBytes();
+ private static final byte[] STAR_DRAW =
"StarDraw".getBytes(StandardCharsets.US_ASCII);
/**
* An ASCII String "Quill96" for Works Files
*/
- private static final byte[] WORKS_QUILL96 = "Quill96".getBytes();
+ private static final byte[] WORKS_QUILL96 =
"Quill96".getBytes(StandardCharsets.US_ASCII);
/**
* An ASCII String "MSGraph.Chart" for embedded MSGraph files
* The full designator includes a version, e.g. MSGraph.Chart.8
*/
- private static final byte[] MS_GRAPH_CHART_BYTES =
"MSGraph.Chart".getBytes();
-
+ private static final byte[] MS_GRAPH_CHART_BYTES =
"MSGraph.Chart".getBytes(StandardCharsets.US_ASCII);
+
/**
* Regexp for matching the MPP Project Data stream
*/
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].