From c08e55fc6102ff337a2fccfe9835dcbcaef359d7 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Sat, 27 Jan 2007 23:31:42 +0000 Subject: [PATCH] Make regex non-greedy. Props Curloso and Viper007Bond. fixes #3698 git-svn-id: http://svn.automattic.com/wordpress/trunk@4821 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 0e6049684a..f1c620286e 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -74,16 +74,16 @@ function &get_children($args = '', $output = OBJECT) { // get extended entry info () function get_extended($post) { //Match the new style more links - if (preg_match('//', $post, $matches)) { - list($main,$extended) = explode($matches[0],$post,2); + if ( preg_match('//', $post, $matches) ) { + list($main, $extended) = explode($matches[0], $post, 2); } else { $main = $post; $extended = ''; } // Strip leading and trailing whitespace - $main = preg_replace('/^[\s]*(.*)[\s]*$/','\\1',$main); - $extended = preg_replace('/^[\s]*(.*)[\s]*$/','\\1',$extended); + $main = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $main); + $extended = preg_replace('/^[\s]*(.*)[\s]*$/', '\\1', $extended); return array('main' => $main, 'extended' => $extended); }