Code Duplication    Length = 9-9 lines in 2 locations

src/PhpSpreadsheet/Reader/Html.php 1 location

@@ 578-586 (lines=9) @@
575
     *
576
     * @throws Exception
577
     */
578
    public function securityScan($xml)
579
    {
580
        $pattern = '/\\0?' . implode('\\0?', str_split('<!ENTITY')) . '\\0?/';
581
        if (preg_match($pattern, $xml)) {
582
            throw new Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks');
583
        }
584
585
        return $xml;
586
    }
587
588
    /**
589
     * Apply inline css inline style.

src/PhpSpreadsheet/Reader/BaseReader.php 1 location

@@ 234-242 (lines=9) @@
231
     *
232
     * @throws Exception
233
     */
234
    public function securityScan($xml)
235
    {
236
        $pattern = '/\\0?' . implode('\\0?', str_split('<!DOCTYPE')) . '\\0?/';
237
        if (preg_match($pattern, $xml)) {
238
            throw new Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks');
239
        }
240
241
        return $xml;
242
    }
243
244
    /**
245
     * Scan theXML for use of <!ENTITY to prevent XXE/XEE attacks.