Skip to content

Commit

Permalink
Fix PHP 8.1 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Sep 27, 2024
1 parent 18edfd2 commit b12d83f
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Formula/php@8.1-debug-zts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,19 @@ def php_version
end

__END__
diff --git a/ext/xml/compat.c b/ext/xml/compat.c
index 242cc4ba7c40c..5f55dc62b3687 100644
--- a/ext/xml/compat.c
+++ b/ext/xml/compat.c
@@ -375,7 +375,7 @@ _get_entity(void *user, const xmlChar *name)
if (ret == NULL)
ret = xmlGetDocEntity(parser->parser->myDoc, name);

- if (ret == NULL || (parser->parser->instate != XML_PARSER_ENTITY_VALUE && parser->parser->instate != XML_PARSER_ATTRIBUTE_VALUE)) {
+ if (ret == NULL || parser->parser->instate == XML_PARSER_CONTENT) {
if (ret == NULL || ret->etype == XML_INTERNAL_GENERAL_ENTITY || ret->etype == XML_INTERNAL_PARAMETER_ENTITY || ret->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
/* Predefined entities will expand unless no cdata handler is present */
if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata)) {
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 1e31934f..49d430c4 100644
--- a/Zend/zend_execute_API.c
Expand Down
13 changes: 13 additions & 0 deletions Formula/php@8.1-debug.rb
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,19 @@ def php_version
end

__END__
diff --git a/ext/xml/compat.c b/ext/xml/compat.c
index 242cc4ba7c40c..5f55dc62b3687 100644
--- a/ext/xml/compat.c
+++ b/ext/xml/compat.c
@@ -375,7 +375,7 @@ _get_entity(void *user, const xmlChar *name)
if (ret == NULL)
ret = xmlGetDocEntity(parser->parser->myDoc, name);

- if (ret == NULL || (parser->parser->instate != XML_PARSER_ENTITY_VALUE && parser->parser->instate != XML_PARSER_ATTRIBUTE_VALUE)) {
+ if (ret == NULL || parser->parser->instate == XML_PARSER_CONTENT) {
if (ret == NULL || ret->etype == XML_INTERNAL_GENERAL_ENTITY || ret->etype == XML_INTERNAL_PARAMETER_ENTITY || ret->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
/* Predefined entities will expand unless no cdata handler is present */
if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata)) {
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 1e31934f..49d430c4 100644
--- a/Zend/zend_execute_API.c
Expand Down
13 changes: 13 additions & 0 deletions Formula/php@8.1-zts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,19 @@ def php_version
end

__END__
diff --git a/ext/xml/compat.c b/ext/xml/compat.c
index 242cc4ba7c40c..5f55dc62b3687 100644
--- a/ext/xml/compat.c
+++ b/ext/xml/compat.c
@@ -375,7 +375,7 @@ _get_entity(void *user, const xmlChar *name)
if (ret == NULL)
ret = xmlGetDocEntity(parser->parser->myDoc, name);

- if (ret == NULL || (parser->parser->instate != XML_PARSER_ENTITY_VALUE && parser->parser->instate != XML_PARSER_ATTRIBUTE_VALUE)) {
+ if (ret == NULL || parser->parser->instate == XML_PARSER_CONTENT) {
if (ret == NULL || ret->etype == XML_INTERNAL_GENERAL_ENTITY || ret->etype == XML_INTERNAL_PARAMETER_ENTITY || ret->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
/* Predefined entities will expand unless no cdata handler is present */
if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata)) {
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 1e31934f..49d430c4 100644
--- a/Zend/zend_execute_API.c
Expand Down
13 changes: 13 additions & 0 deletions Formula/php@8.1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,19 @@ def php_version
end

__END__
diff --git a/ext/xml/compat.c b/ext/xml/compat.c
index 242cc4ba7c40c..5f55dc62b3687 100644
--- a/ext/xml/compat.c
+++ b/ext/xml/compat.c
@@ -375,7 +375,7 @@ _get_entity(void *user, const xmlChar *name)
if (ret == NULL)
ret = xmlGetDocEntity(parser->parser->myDoc, name);

- if (ret == NULL || (parser->parser->instate != XML_PARSER_ENTITY_VALUE && parser->parser->instate != XML_PARSER_ATTRIBUTE_VALUE)) {
+ if (ret == NULL || parser->parser->instate == XML_PARSER_CONTENT) {
if (ret == NULL || ret->etype == XML_INTERNAL_GENERAL_ENTITY || ret->etype == XML_INTERNAL_PARAMETER_ENTITY || ret->etype == XML_INTERNAL_PREDEFINED_ENTITY) {
/* Predefined entities will expand unless no cdata handler is present */
if (parser->h_default && ! (ret && ret->etype == XML_INTERNAL_PREDEFINED_ENTITY && parser->h_cdata)) {
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 1e31934f..49d430c4 100644
--- a/Zend/zend_execute_API.c
Expand Down

0 comments on commit b12d83f

Please sign in to comment.