Mentions: 1MB limit for attempting to link mentions, otherwise bail (#540)

This commit is contained in:
Matt Wiebe 2023-10-30 14:32:04 -05:00 committed by GitHub
parent 70cefc9712
commit eda6d6d785
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,6 +26,10 @@ class Mention {
* @return string the filtered post-content
*/
public static function the_content( $the_content ) {
// small protection against execution timeouts: limit to 1 MB
if ( mb_strlen( $the_content ) > MB_IN_BYTES ) {
return $the_content;
}
$tag_stack = array();
$protected_tags = array(
'pre',