Using non-English characters in post content causes fatal error - Wordpress

Viewed 62

I have a freshly installed clean Wordpress. No plugins or custom themes. Whenever I try to create a new post the website shows a fatal error every time I have non-English characters in the content field no matter if it's hieroglyphs, Cyrillic letters or whatever. However, post title or url can contain non-English characters just fine. I have checked the wp-config.php and DB_CHARSET is set to the default utf8mb4 setting.

This is the error log that I get:

Notice: Undefined offset: 0 in /var/www/test-website/public_html/wp-includes/class-wp-block.php on line 224

Notice: Trying to get property 'parsed_block' of non-object in /var/www/test-website/public_html/wp-includes/class-wp-block.php on line 228

Notice: Trying to access array offset on value of type null in /var/www/test-website/public_html/wp-includes/block-supports/elements.php on line 100

Notice: Trying to get property 'parsed_block' of non-object in /var/www/test-website/public_html/wp-includes/class-wp-block.php on line 233

Notice: Trying to get property 'parsed_block' of non-object in /var/www/test-website/public_html/wp-includes/class-wp-block.php on line 236

Notice: Trying to access array offset on value of type null in /var/www/test-website/public_html/wp-includes/blocks/gallery.php on line 20

Notice: Trying to access array offset on value of type null in /var/www/test-website/public_html/wp-includes/blocks/latest-posts.php on line 234

Notice: Trying to access array offset on value of type null in /var/www/test-website/public_html/wp-includes/blocks/navigation.php on line 666

Warning: Creating default object from empty value in /var/www/test-website/public_html/wp-includes/class-wp-block.php on line 236

Notice: Undefined property: stdClass::$context in /var/www/test-website/public_html/wp-includes/class-wp-block.php on line 239

Fatal error: Uncaught Error: Call to undefined method stdClass::render() in /var/www/test-website/public_html/wp-includes/class-wp-block.php:241 Stack trace:
 #0 /var/www/test-website/public_html/wp-includes/blocks.php(901): WP_Block->render()
 #1 /var/www/test-website/public_html/wp-includes/blocks.php(794): render_block()
 #2 /var/www/test-website/public_html/wp-includes/formatting.php(3874): excerpt_remove_blocks()
 #3 /var/www/test-website/public_html/wp-includes/class-wp-hook.php(307): wp_trim_excerpt()
 #4 /var/www/test-website/public_html/wp-includes/plugin.php(191): WP_Hook->apply_filters()
 #5 /var/www/test-website/public_html/wp-includes/post-template.php(429): apply_filters()
 #6 /var/www/test-website/public_html/wp-includes/blocks/post-excerpt.php(21): get_the_excerpt()
 #7 /var/www/test-website/public_html/wp-includes/class-wp-block.php(255): render_block_core_post_excerpt()
 #8 /var/www/test-website/public_html/wp-includes/class-wp-block.php(241): WP_Block->render()
 #9 /var/www/test-website/public_html/wp-includes/class-wp-block.php(241): WP_Block->render()
 #1 in /var/www/test-website/public_html/wp-includes/class-wp-block.php on line 241

Would be nice if someone could help with this as I tried looking for the answer but didn't find anything.

1 Answers

Switching to PHP 8 fixed the problem. Which is weird considering Wordpress requires PHP 7.4 or higher in their requirements section and I was using PHP 7.4 before. Case closed.

Related