Make WordPress Core

Changeset 4821


Ignore:
Timestamp:
01/27/2007 11:31:42 PM (18 years ago)
Author:
markjaquith
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.