From 24e66041c08f8cc21636fafb9060d19cc607a911 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Sat, 27 Jan 2007 23:31:42 +0000 Subject: [PATCH] Make regex non-greedy. Props Curloso and Viper007Bond. fixes #3698 git-svn-id: https://develop.svn.wordpress.org/trunk@4821 602fd350-edb4-49c9-b593-d223f7449a82 --- 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); }