Menu

#159 V1.5 Attribute selector class^= "starts with a certain value" can false match

closed
None
2022-05-05
2016-11-16
chrisjj
No

Docs say

[attribute^=value] Matches elements that have the specified attribute and it starts with a certain value.

so this code:

<?php
include 'simple_html_dom.php';

echo count(
 str_get_html("<html><body><span class='first second'>Hello!</span></body></html>")
 ->
 find('span[class^=second]')
 );

should output 0. On V1.5, it outputs 1.

It's possible behaviour is intended (since it can be useful) and the bug is in the documentation.

Discussion

  • LogMANOriginal

    LogMANOriginal - 2018-12-15
    • status: open --> closed
    • assigned_to: John Schlick --> LogMANOriginal
     
  • LogMANOriginal

    LogMANOriginal - 2018-12-15

    Thanks for reporting this issue!

    I've used your testing data to verify that it works in latest version.

     
  • Jeffrey Kastner

    Jeffrey Kastner - 2022-05-05
    • disregard
     

    Last edit: Jeffrey Kastner 2022-05-05

Log in to post a comment.

MongoDB Logo MongoDB