WordPress.org

Make WordPress Core

Ticket #15203: wordpress_export_cdata.patch

File wordpress_export_cdata.patch, 459 bytes (added by ceefour, 9 years ago)

Patch to fix export (this makes WXR readable to XML-compliant importers, but perhaps not WordPress's own importer)

  • wp-admin/includes/export.php

    diff --git a/wp-admin/includes/export.php b/wp-admin/includes/export.php
    index a9e8f22..cd3a9d4 100644
    a b function export_wp( $args = array() ) { 
    138138                        $str = utf8_encode( $str );
    139139
    140140                // $str = ent2ncr(esc_html($str));
     141                $str = str_replace(']]>', ']]]]><![CDATA[>', $str);
    141142                $str = "<![CDATA[$str" . ( ( substr( $str, -1 ) == ']' ) ? ' ' : '') . "]]>";
    142143
    143144                return $str;