Changeset 4821

Show
Ignore:
Timestamp:
01/27/07 23:31:42 (1 year ago)
Author:
markjaquith
Message:

Make <!--more--> regex non-greedy. Props Curloso and Viper007Bond. fixes #3698

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-includes/post.php

    r4773 r4821  
    7575function get_extended($post) { 
    7676    //Match the new style more links 
    77     if (preg_match('/<!--more(.+?)?-->/', $post, $matches)) { 
    78         list($main,$extended) = explode($matches[0],$post,2); 
     77    if ( preg_match('/<!--more(.*?)-->/', $post, $matches) ) { 
     78        list($main, $extended) = explode($matches[0], $post, 2); 
    7979    } else { 
    8080        $main = $post; 
     
    8383     
    8484    // Strip leading and trailing whitespace 
    85     $main = preg_replace('/^[\s]*(.*)[\s]*$/','\\1',$main); 
    86     $extended = preg_replace('/^[\s]*(.*)[\s]*$/','\\1',$extended); 
     85    $main = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $main); 
     86    $extended = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $extended); 
    8787 
    8888    return array('main' => $main, 'extended' => $extended);