bug #16873 Able to load big xml files with DomCrawler (zorn-v)

This PR was submitted for the 2.8 branch but it was merged into the 2.3 branch instead (closes #16873).

Discussion
----------

Able to load big xml files with DomCrawler

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

Commits
-------

3dae825 Able to load big xml files with DomCrawler
This commit is contained in:
Fabien Potencier 2016-01-25 09:23:30 +01:00
commit ec26f6ece0
1 changed files with 1 additions and 1 deletions

View File

@ -230,7 +230,7 @@ class Crawler extends \SplObjectStorage
if ('' !== trim($content)) {
// remove the default namespace to make XPath expressions simpler
@$dom->loadXML(str_replace('xmlns', 'ns', $content), LIBXML_NONET);
@$dom->loadXML(str_replace('xmlns', 'ns', $content), LIBXML_NONET | (defined('LIBXML_PARSEHUGE') ? LIBXML_PARSEHUGE : 0));
}
libxml_use_internal_errors($internalErrors);