[php-src] PR #22701: ext/dom: getElementsByClassName() item() returns wrong element on ran…
| From: | devnexen | Date: | Sat, 11 Jul 2026 20:35:45 +0000 |
| Subject: | [php-src] PR #22701: ext/dom: getElementsByClassName() item() returns wrong element on ran… | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-36980@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/22701
Author: devnexen
…dom access.
The loop never advanced past the current match, so a cold item($n) with $n >= 1, or a backwards
seek, returned the first match. Fixed by mirroring dom_map_get_elements_item(): advance to the next
match once per remaining index.