Skip to content

Commit 10c2214

Browse files
committed
fix regex for stripping title. Got borked at some point!
1 parent a919d7d commit 10c2214

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

inc/class-importer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,15 +288,15 @@ protected function update_post_from_markdown_source( $post_id ) {
288288
$yaml_parser = new Yaml();
289289
$yaml = $yaml_parser->loadString( $yaml_matches[1] );
290290
// Strip YAML doc from the header
291-
$markdown = substr( $markdown, strlen( $yaml_matches[0] ) );
291+
$markdown = mb_substr( $markdown, mb_strlen( $yaml_matches[0] ) );
292292
} else {
293293
$yaml = array();
294294
}
295295

296296
$title = null;
297297
if ( preg_match( '/^\n*#\s(.+)/', $markdown, $matches ) ) {
298298
$title = $matches[1];
299-
$markdown = preg_replace( '/^\n*#\swp\s(.+)/', '', $markdown );
299+
$markdown = preg_replace( '/^\n*#\s(.+)/', '', $markdown );
300300
}
301301
// Allow YAML override.
302302
if ( isset( $yaml['title'] ) ) {

0 commit comments

Comments
 (0)