Ticket #23275: 23275.patch
File 23275.patch, 1.1 KB (added by , 11 years ago) |
---|
-
wordpress-importer.php
703 703 // export gets meta straight from the DB so could have a serialized string 704 704 if ( ! $value ) 705 705 $value = maybe_unserialize( $meta['value'] ); 706 706 // Occationally, line-endings break unserialize() 707 if ( empty( $value ) ) // Try normalizing... 708 $value = maybe_unserialize( str_replace( array("\r\n", "\r", "\n"), "\r\n", $meta['value'] ) ); 709 if ( empty( $value ) ) // Adjust string length if needed 710 $value = maybe_unserialize( 711 preg_replace( // e flag deprecated in PHP 5.5.0 I think 712 '!s:(\d+):"(.*?)";!se', 713 "'s:'.strlen('$2').':\"$2\";'", 714 $meta['value'] 715 ) 716 ); 717 707 718 add_post_meta( $post_id, $key, $value ); 708 719 do_action( 'import_post_meta', $post_id, $key, $value ); 709 720 710 721 // if the post has a featured image, take note of this in case of remap 711 722 if ( '_thumbnail_id' == $key ) 712 723 $this->featured_images[$post_id] = (int) $value;