Skip to content

PHP speadsheet 1.5.2 modifies libxml_disable_entity_loader value #801

@stephane-de

Description

@stephane-de

This is:

  • a bug report

What is the expected behavior?

The value of libxml_disable_entity_loader stay the same after I use PhpSpreadsheet
(In this case when I input a PDF file, PHPSpreadsheet fails to open it, and throws an exception, but still, the value of libxml_disable_entity_loader is changed)

What is the current behavior?

In 1.5.2
The value is changed by :
libxml_disable_entity_loader(true);

What are the steps to reproduce?

(where test.pdf is a valid PDF file)

<?php

require __DIR__ . '/vendor/autoload.php';

$previousValue =  libxml_disable_entity_loader(false);
print_r('previous value: '.$previousValue."\n");

// Create new Spreadsheet object
$spreadsheet = new \PhpOffice\PhpSpreadsheet\Spreadsheet();
try {
    \PhpOffice\PhpSpreadsheet\IOFactory::load('test.pdf');
} catch(\Throwable $e) {

}

// add code that show the issue here...
$newValue =  libxml_disable_entity_loader(false);
print_r('new value: '.$newValue."\n");

With phpSpreadsheet 1.5.2

php test.php 
previous value: 
new value: 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions