Make WordPress Core

Changeset 4822


Ignore:
Timestamp:
01/27/2007 11:32:57 PM (20 years ago)
Author:
markjaquith
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.1/wp-includes/post.php

    r4773 r4822  
    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.