We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b01a485 commit 09b979dCopy full SHA for 09b979d
src/PhpSpreadsheet/Reader/Security/XmlScanner.php
@@ -18,14 +18,22 @@ class XmlScanner
18
19
private static $libxmlDisableEntityLoaderValue;
20
21
+ /**
22
+ * @var bool
23
+ */
24
+ private static $shutdownRegistered = false;
25
+
26
public function __construct($pattern = '<!DOCTYPE')
27
{
28
$this->pattern = $pattern;
29
30
$this->disableEntityLoaderCheck();
31
32
// A fatal error will bypass the destructor, so we register a shutdown here
- register_shutdown_function([__CLASS__, 'shutdown']);
33
+ if (!self::$shutdownRegistered) {
34
+ self::$shutdownRegistered = true;
35
+ register_shutdown_function([__CLASS__, 'shutdown']);
36
+ }
37
}
38
39
public static function getInstance(Reader\IReader $reader)
0 commit comments