[
https://issues.apache.org/jira/browse/TIKA-4857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18109943#comment-18109943
]
Hudson commented on TIKA-4857:
------------------------------
SUCCESS: Integrated in Jenkins build Tika ยป tika-main-jdk17 #1601 (See
[https://ci-builds.apache.org/job/Tika/job/tika-main-jdk17/1601/])
TIKA-4857: embedded-limits maxDepth counts embedding levels, not parser layers
(#3098) (github:
[https://github.com/apache/tika/commit/b6103ab2e4a33c836c1e2eb1357e0c8d7c4f8fb7])
* (edit)
tika-core/src/main/java/org/apache/tika/extractor/ParsingEmbeddedDocumentExtractor.java
* (edit) tika-core/src/main/java/org/apache/tika/parser/ParseRecord.java
* (edit)
tika-pipes/tika-pipes-core/src/main/java/org/apache/tika/pipes/core/extractor/UnpackExtractor.java
* (add)
tika-core/src/test/java/org/apache/tika/extractor/EmbeddedDepthLimitTest.java
* (edit) CHANGES.txt
> embedded-limits.maxDepth counts parser layers, not embedding levels
> -------------------------------------------------------------------
>
> Key: TIKA-4857
> URL: https://issues.apache.org/jira/browse/TIKA-4857
> Project: Tika
> Issue Type: Bug
> Components: parser
> Reporter: Dominik Schmidt
> Priority: Major
> Fix For: 4.1.0
>
>
> The javadoc of EmbeddedLimits says maxDepth is the maximum nesting depth of
> embedded documents that are still parsed (maxDepth=1: depth 1 parsed, depth 2
> not). In practice maxDepth=2 parses depth 1 only; depth 2 needs maxDepth=3.
> Reproduced with RecursiveParserWrapper on a DOCX whose EMF thumbnail is
> rendered (the rendering is a depth-2 embedded document):
> - maxDepth 1: depth 1 only, tk:exception:embedded-depth-limit-reached set
> - maxDepth 2: depth 1 only, limit reached set
> - maxDepth 3: depth 1 and 2
> - maxDepth -1: everything
> ParseRecord.depth is incremented in CompositeParser.parse for every composite
> layer a parse passes through; with AutoDetectParser wrapping DefaultParser
> that is two increments per document level, and
> ParsingEmbeddedDocumentExtractor compares that counter with maxDepth + 1. The
> limit should be checked against the embedding depth (tk:embedded-depth of the
> child), independent of how parsers are composed. The same off-by-one applies
> to /unpack with embedded-limits in tika-server.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)