Skip to content

Commit 340e9d1

Browse files
committed
Restore filesize behaviour in XML (didn't mean to remove it)
1 parent 3043666 commit 340e9d1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Xml.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,12 @@ public static function validate($filePath)
4040
throw new XmlException('XML file is not readable');
4141
}
4242

43+
// domdocument dies silently when given a big (1.7GB) file, though known to cope with 892Mb
44+
// @todo: look at using xmlreader instead @see: https://gist.github.com/tentacode/5934634 for some examples
45+
if (filesize($filePath) > 1000000000) { // 1Gb
46+
return;
47+
}
48+
4349
libxml_use_internal_errors(true);
4450

4551
set_error_handler(function ($errno, $errstr, $errfile, $errline, $errcontext) {

0 commit comments

Comments
 (0)