Expand Cut Tags

No cut tags
[syndicated profile] wordpresstrac_feed

Posted by mamunur105

The export process throws an error related to the wxr_cdata() function.

The problem happens because the function is called with values that are not always strings — sometimes a meta value is null or another type. When that happens, the function breaks during export.

[

04-Dec-2025 07:13:56 UTC] PHP Fatal error:  Uncaught TypeError: wp_is_valid_utf8(): Argument #1 ($bytes) must be of type string, null given, called in /Users/radiustheme07/Local Sites/shopbuilder/app/public/wp-admin/includes/export.php on line 246 and defined in /Users/radiustheme07/Local Sites/shopbuilder/app/public/wp-includes/utf8.php:39
Stack trace:
#0 /Users/radiustheme07/Local Sites/shopbuilder/app/public/wp-admin/includes/export.php(246): wp_is_valid_utf8(NULL)
#1 /Users/radiustheme07/Local Sites/shopbuilder/app/public/wp-admin/includes/export.php(682): wxr_cdata(NULL)
#2 /Users/radiustheme07/Local Sites/shopbuilder/app/public/wp-admin/export.php(123): export_wp(Array)
#3 {main}
  thrown in /Users/radiustheme07/Local Sites/shopbuilder/app/public/wp-includes/utf8.php on line 39

To fix it, WordPress should add a simple type check before processing the value. For example:

<?php
function wxr_cdata( $str ) {
        // Make sure the value is a string before processing.
        if ( ! is_string( $str ) ) {
                return '<![CDATA[]]>'; // Fail-safe output for invalid or null values.
        }
        if ( ! wp_is_valid_utf8( $str ) ) {
                $str = utf8_encode( $str );
        }
        $str = '<![CDATA[' . str_replace( ']]>', ']]]]><![CDATA[>', $str ) . ']]>';
        return $str;
}
[syndicated profile] wordpresstrac_feed

Posted by jonsurrell

fixed:

In 61350:

HTML API: Ensure correct encoding of modified class names.

Some class names with HTML character references could be mishandled, for example:

  • Failure to remove an existing class like & with ::remove_class( '&' )
  • Double-encoding of an existing class like & after a modification, becoming &amp;

The second case manifested after double-encoding prevention was removed from ::set_attribute() in [60919].

Developed in https://github.com/WordPress/wordpress-develop/pull/10591.

Reviewed by dmsnell, mamaduka.
Merges [61346] to the 6.9 branch.

Props jonsurrell, dmsnell.
Fixes #64340.

Profile

jeshyr: Blessed are the broken. Harry Potter. (Default)
Ricky Buchanan