@@ -2494,8 +2494,9 @@ private function get_enqueued_attribute_value( $comparable_name ) {
24942494 * 2. Double-quoting starts one after the equals sign.
24952495 * 3. Double-quoting ends at the last character in the update.
24962496 */
2497- $ enqueued_value = substr ( $ enqueued_text , $ equals_at + 2 , -1 );
2498- return WP_HTML_Decoder::decode_attribute ( $ enqueued_value );
2497+ $ start_at = $ equals_at + 2 ;
2498+ $ end_at = strlen ( $ enqueued_text ) - 1 ;
2499+ return WP_HTML_Decoder::decode_attribute ( $ enqueued_text , $ start_at , $ end_at - $ start_at );
24992500 }
25002501
25012502 /**
@@ -2566,9 +2567,7 @@ public function get_attribute( $name ) {
25662567 return true ;
25672568 }
25682569
2569- $ raw_value = substr ( $ this ->html , $ attribute ->value_starts_at , $ attribute ->value_length );
2570-
2571- return WP_HTML_Decoder::decode_attribute ( $ raw_value );
2570+ return WP_HTML_Decoder::decode_attribute ( $ this ->html , $ attribute ->value_starts_at , $ attribute ->value_length );
25722571 }
25732572
25742573 /**
@@ -2841,16 +2840,14 @@ public function get_modifiable_text() {
28412840 return '' ;
28422841 }
28432842
2844- $ text = substr ( $ this ->html , $ this ->text_starts_at , $ this ->text_length );
2845-
28462843 // Comment data is not decoded.
28472844 if (
28482845 self ::STATE_CDATA_NODE === $ this ->parser_state ||
28492846 self ::STATE_COMMENT === $ this ->parser_state ||
28502847 self ::STATE_DOCTYPE === $ this ->parser_state ||
28512848 self ::STATE_FUNKY_COMMENT === $ this ->parser_state
28522849 ) {
2853- return $ text ;
2850+ return substr ( $ this -> html , $ this -> text_starts_at , $ this -> text_length ) ;
28542851 }
28552852
28562853 $ tag_name = $ this ->get_tag ();
@@ -2865,10 +2862,10 @@ public function get_modifiable_text() {
28652862 'STYLE ' === $ tag_name ||
28662863 'XMP ' === $ tag_name
28672864 ) {
2868- return $ text ;
2865+ return substr ( $ this -> html , $ this -> text_starts_at , $ this -> text_length ) ;
28692866 }
28702867
2871- $ decoded = WP_HTML_Decoder::decode_text_node ( $ text );
2868+ $ decoded = WP_HTML_Decoder::decode_text_node ( $ this -> html , $ this -> text_starts_at , $ this -> text_length );
28722869
28732870 /*
28742871 * TEXTAREA skips a leading newline, but this newline may appear not only as the
0 commit comments