Skip to content

Commit

Permalink
Add note about invalid input to wp_kses_hair()
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed May 17, 2024
1 parent 97a55ac commit 5079cbc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/wp-includes/kses.php
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,16 @@ function wp_kses_hair( $attr, $allowed_protocols ) {
}
}

if ( false !== $processor->next_token() ) {
/*
* There should be no further HTML syntax after the fake tag created
* at the top of this function. Had there been more it would have
* implied an error when creating the attribute string as input,
* meaning that something escaped out of the tag or attribute value.
*/
return $attributes;
}

return $attributes;
}

Expand Down

0 comments on commit 5079cbc

Please sign in to comment.