[wp-trac] [WordPress Trac] #58637: HTML API: Fatal error processing document with unclosed attribute

WordPress Trac noreply at wordpress.org
Tue Jun 27 12:26:34 UTC 2023


#58637: HTML API: Fatal error processing document with unclosed attribute
-------------------------------------------------+-------------------------
 Reporter:  dlh                                  |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  HTML API                             |     Version:  6.2
 Severity:  normal                               |  Resolution:
 Keywords:  has-unit-tests needs-patch dev-      |     Focuses:
  feedback                                       |
-------------------------------------------------+-------------------------
Changes (by costdev):

 * keywords:  has-unit-tests needs-patch => has-unit-tests needs-patch dev-
     feedback


Comment:

 A quick test shows that the new test and the existing tests pass if you
 change [https://github.com/WordPress/wordpress-
 develop/blob/12ed5ccb0a61cf684682a94e9b9c02dd11bb7d75/src/wp-includes
 /html-api/class-wp-html-tag-processor.php#L1195 this line]

 from:
 {{{#!php
 $attribute_end              = $value_start + $value_length + 1;
 }}}

 to:
 {{{#!php
 $attribute_end              = min( strlen( $this->html ), $value_start +
 $value_length + 1 );
 }}}

 Pinging @dmsnell for insight into the issue and whether the above (or a
 variation of it) is an appropriate fix.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58637#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list