diff -pruN livejournal-importer.orig/livejournal-importer.php livejournal-importer/livejournal-importer.php
|
old
|
new
|
class LJ_API_Import extends WP_Importer |
| 374 | 374 | $post_content = str_replace( '<br>', '<br />', $post_content ); |
| 375 | 375 | $post_content = str_replace( '<hr>', '<hr />', $post_content ); |
| 376 | 376 | // lj-cut ==> <!--more--> |
| 377 | | $post_content = preg_replace( '|<lj-cut text="([^"]*)">|is', '<!--more $1-->', $post_content ); |
| | 377 | $post_content = preg_replace( '|<\s*lj-cut\s+text="([^"]*)"\s*>|is', '<!--more $1-->', $post_content ); |
| 378 | 378 | $post_content = str_replace( array( '<lj-cut>', '</lj-cut>' ), array( '<!--more-->', '' ), $post_content ); |
| 379 | 379 | $first = strpos( $post_content, '<!--more' ); |
| 380 | 380 | $post_content = substr( $post_content, 0, $first + 1 ) . preg_replace( '|<!--more(.*)?-->|sUi', '', substr( $post_content, $first + 1 ) ); |
| … |
… |
class LJ_API_Import extends WP_Importer |
| 415 | 415 | |
| 416 | 416 | // Convert lj-user tags to links to that user |
| 417 | 417 | function translate_lj_user( $str ) { |
| 418 | | return preg_replace( '|<lj\s+user\s*=\s*["\']([\w-]+)["\']>|', '<a href="http://$1.livejournal.com/" class="lj-user">$1</a>', $str ); |
| | 418 | return preg_replace( '|<\s*lj\s+user\s*=\s*["\']([\w-]+)["\']\s*/?\s*>|', '<a href="http://$1.livejournal.com/" class="lj-user">$1</a>', $str ); |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | function insert_postmeta( $post_id, $post ) { |