1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.4'

* PHP-8.4:
  Backport lexbor/lexbor#274
This commit is contained in:
Niels Dossche
2025-05-04 12:58:07 +02:00
2 changed files with 15 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
*
* Author: Alexander Borisov <borisov@lexbor.com>
* Adapted for PHP + libxml2 by: Niels Dossche <nielsdos@php.net>
* Based on Lexbor 2.4.0 (upstream commit e9d35f6384de7bd8c1b79e7111bc3a44f8822967)
* Based on Lexbor (upstream commit b347aa4e4da4e82b1cae18989ceea1aa0278daf1)
*/
#include <libxml/xmlstring.h>
@@ -967,7 +967,7 @@ lxb_selectors_state_has_relative(const xmlNode *node,
break;
}
while (node !=root && node->next == NULL) {
while (node != root && node->next == NULL && node->parent != NULL) {
node = node->parent;
}

View File

@@ -0,0 +1,13 @@
--TEST--
Lexbor #274
--EXTENSIONS--
dom
--FILE--
<?php
$dom = Dom\HTMLDocument::createFromString('<html><body><div></div>\n</body></html>', LIBXML_NOERROR);
var_dump($dom->querySelector('a:has(+ b)'));
?>
--EXPECT--
NULL