### Eclipse Workspace Patch 1.0
#P wordpress-trunk bare
Index: wp-includes/query.php
===================================================================
--- wp-includes/query.php	(revision 17484)
+++ wp-includes/query.php	(working copy)
@@ -3494,26 +3494,24 @@
 
 	$currentday = mysql2date('d.m.y', $post->post_date, false);
 	$currentmonth = mysql2date('m', $post->post_date, false);
-	$numpages = 1;
 	$page = get_query_var('page');
 	if ( !$page )
 		$page = 1;
 	if ( is_single() || is_page() || is_feed() )
 		$more = 1;
 	$content = $post->post_content;
-	if ( strpos( $content, '<!--nextpage-->' ) ) {
+	$marker = '<!--nextpage-->';
+	$has_marker = (bool) strpos( $content, $marker );
+	$multipage = (int) $has_marker;
+	if ( $has_marker ) {
 		if ( $page > 1 )
 			$more = 1;
-		$multipage = 1;
-		$content = str_replace("\n<!--nextpage-->\n", '<!--nextpage-->', $content);
-		$content = str_replace("\n<!--nextpage-->", '<!--nextpage-->', $content);
-		$content = str_replace("<!--nextpage-->\n", '<!--nextpage-->', $content);
-		$pages = explode('<!--nextpage-->', $content);
-		$numpages = count($pages);
+		$content = str_replace(array("\n{$marker}", "{$marker}\n"), $marker, $content);
+		$pages = explode($marker, $content);
 	} else {
-		$pages = array( $post->post_content );
-		$multipage = 0;
+		$pages = array( $content );
 	}
+	$numpages = count($pages);
 
 	do_action_ref_array('the_post', array(&$post));
 
