Conversation
As per the PHP 8.0 changelog: > `libxml_disable_entity_loader()` has been deprecated. As libxml 2.9.0 is now > required, external entity loading is guaranteed to be disabled by default, > and this function is no longer needed to protect against XXE attacks. Source: https://github.com/php/php-src/blob/71bfa5344ab207072f4cd25745d7023096338385/UPGRADING#L808-L811 Calling the function conditionally will prevent deprecation warnings. And while the `PHP_VERSION_ID` constant was introduced in PHP 5.2.7, no additional condition is needed to check for its existance as the condition won't be executed when the `libxml_disable_entity_loader()` function exists check fails and as `libxml_disable_entity_loader()` was introduced in PHP 5.2.11, this means, we're good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As per the PHP 8.0 changelog:
Source: https://github.com/php/php-src/blob/71bfa5344ab207072f4cd25745d7023096338385/UPGRADING#L808-L811
Calling the function conditionally will prevent deprecation warnings.
And while the
PHP_VERSION_IDconstant was introduced in PHP 5.2.7, no additional condition is needed to check for its existance as the condition won't be executed when thelibxml_disable_entity_loader()function exists check fails and aslibxml_disable_entity_loader()was introduced in PHP 5.2.11, this means, we're good.