You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ni...@apache.org on 2018/02/07 12:50:00 UTC

[tika] branch master updated: TIKA-2567 Make the Matlib single+no output function magic a bit more specific, to avoid false positives with JavaScript

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 dbf35b6  TIKA-2567 Make the Matlib single+no output function magic a bit more specific, to avoid false positives with JavaScript
dbf35b6 is described below

commit dbf35b6b4eff1cdcacf6a1265bc025c3bc7a6dd0
Author: Nick Burch <ni...@gagravarr.org>
AuthorDate: Wed Feb 7 12:49:53 2018 +0000

    TIKA-2567 Make the Matlib single+no output function magic a bit more specific, to avoid false positives with JavaScript
---
 .../src/main/resources/org/apache/tika/mime/tika-mimetypes.xml     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml b/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
index e3e61db..2a723df 100644
--- a/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
+++ b/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
@@ -6481,7 +6481,12 @@
     </magic>
     <!-- Single-output or no output function definition -->
     <magic priority="40">
-      <match value="function [a-zA-Z][A-Za-z0-9_]{0,5}" type="regex" offset="0"/>
+      <match value="function [a-zA-Z][A-Za-z0-9_]{0,62}\\s*=" type="regex" offset="0"/>
+    </magic>
+    <!-- No-output function definition in short form -->
+    <!-- Be careful to avoid a false-match on JS functions! -->
+    <magic priority="40">
+      <match value="function [a-zA-Z][A-Za-z0-9_]{0,62}[\\r\\n]" type="regex" offset="0"/>
     </magic>
     <!-- Two matlab-style comments fairly early in the file -->
     <magic priority="25">

-- 
To stop receiving notification emails like this one, please contact
nick@apache.org.