Index: plugins/pages/_public.php
===================================================================
--- plugins/pages/_public.php	(revision 1674)
+++ plugins/pages/_public.php	(revision 2566)
@@ -30,15 +30,15 @@
 			$_ctx =& $GLOBALS['_ctx'];
 			$core =& $GLOBALS['core'];
-			
+
 			$core->blog->withoutPassword(false);
-			
+
 			$params = new ArrayObject(array(
 				'post_type' => 'page',
 				'post_url' => $args));
-			
+
 			$core->callBehavior('publicPagesBeforeGetPosts',$params,$args);
-			
+
 			$_ctx->posts = $core->blog->getPosts($params);
-			
+
 			$_ctx->comment_preview = new ArrayObject();
 			$_ctx->comment_preview['content'] = '';
@@ -49,8 +49,8 @@
 			$_ctx->comment_preview['preview'] = false;
 			$_ctx->comment_preview['remember'] = false;
-			
+
 			$core->blog->withoutPassword(true);
-			
-			
+
+
 			if ($_ctx->posts->isEmpty())
 			{
@@ -62,5 +62,5 @@
 				$post_id = $_ctx->posts->post_id;
 				$post_password = $_ctx->posts->post_password;
-				
+
 				# Password protected entry
 				if ($post_password != '' && !$_ctx->preview)
@@ -72,5 +72,5 @@
 						$pwd_cookie = array();
 					}
-					
+
 					# Check for match
 					if ((!empty($_POST['password']) && $_POST['password'] == $post_password)
@@ -86,10 +86,10 @@
 					}
 				}
-				
+
 				$post_comment =
 					isset($_POST['c_name']) && isset($_POST['c_mail']) &&
 					isset($_POST['c_site']) && isset($_POST['c_content']) &&
 					$_ctx->posts->commentsActive();
-				
+
 				# Posting a comment
 				if ($post_comment)
@@ -103,5 +103,5 @@
 						exit;
 					}
-					
+
 					$name = $_POST['c_name'];
 					$mail = $_POST['c_mail'];
@@ -109,5 +109,5 @@
 					$content = $_POST['c_content'];
 					$preview = !empty($_POST['preview']);
-					
+
 					if ($content != '')
 					{
@@ -120,5 +120,5 @@
 						$content = $core->HTMLfilter($content);
 					}
-					
+
 					$_ctx->comment_preview['content'] = $content;
 					$_ctx->comment_preview['rawcontent'] = $_POST['c_content'];
@@ -126,10 +126,10 @@
 					$_ctx->comment_preview['mail'] = $mail;
 					$_ctx->comment_preview['site'] = $site;
-					
+
 					if ($preview)
 					{
 						# --BEHAVIOR-- publicBeforeCommentPreview
 						$core->callBehavior('publicBeforeCommentPreview',$_ctx->comment_preview);
-						
+
 						$_ctx->comment_preview['preview'] = true;
 					}
@@ -145,8 +145,8 @@
 						$cur->comment_status = $core->blog->settings->system->comments_pub ? 1 : -1;
 						$cur->comment_ip = http::realIP();
-						
+
 						$redir = $_ctx->posts->getURL();
 						$redir .= $core->blog->settings->system->url_scan == 'query_string' ? '&' : '?';
-						
+
 						try
 						{
@@ -154,14 +154,14 @@
 								throw new Exception(__('You must provide a valid email address.'));
 							}
-							
+
 							# --BEHAVIOR-- publicBeforeCommentCreate
 							$core->callBehavior('publicBeforeCommentCreate',$cur);
-							if ($cur->post_id) {					
+							if ($cur->post_id) {
 								$comment_id = $core->blog->addComment($cur);
-							
+
 								# --BEHAVIOR-- publicAfterCommentCreate
 								$core->callBehavior('publicAfterCommentCreate',$cur,$comment_id);
 							}
-							
+
 							if ($cur->comment_status == 1) {
 								$redir_arg = 'pub=1';
@@ -169,5 +169,5 @@
 								$redir_arg = 'pub=0';
 							}
-							
+
 							header('Location: '.$redir.$redir_arg);
 						}
@@ -179,5 +179,5 @@
 					}
 				}
-				
+
 				# The entry
 				if ($_ctx->posts->trackbacksActive()) {
@@ -189,10 +189,10 @@
 		}
 	}
-	
+
 	public static function pagespreview($args)
 	{
 		$core = $GLOBALS['core'];
 		$_ctx = $GLOBALS['_ctx'];
-		
+
 		if (!preg_match('#^(.+?)/([0-9a-z]{40})/(.+?)$#',$args,$m)) {
 			# The specified Preview URL is malformed.
@@ -223,20 +223,20 @@
 	{
 		global $core, $_ctx;
-		
+
 		if (($w->homeonly == 1 && $core->url->type != 'default') ||
 			($w->homeonly == 2 && $core->url->type == 'default')) {
 			return;
 		}
-		
+
 		$params['post_type'] = 'page';
 		$params['limit'] = abs((integer) $w->limit);
 		$params['no_content'] = true;
 		$params['post_selected'] = false;
-		
+
 		$sort = $w->sortby;
 		if (!in_array($sort,array('post_title','post_position','post_dt'))) {
 			$sort = 'post_title';
 		}
-		
+
 		$order = $w->orderby;
 		if ($order != 'asc') {
@@ -244,16 +244,16 @@
 		}
 		$params['order'] = $sort.' '.$order;
-		
+
 		$rs = $core->blog->getPosts($params);
-		
+
 		if ($rs->isEmpty()) {
 			return;
 		}
-		
+
 		$res =
 		($w->content_only ? '' : '<div class="pages'.($w->class ? ' '.html::escapeHTML($w->class) : '').'">').
 		($w->title ? '<h2>'.html::escapeHTML($w->title).'</h2>' : '').
 		'<ul>';
-		
+
 		while ($rs->fetch()) {
 			$class = '';
@@ -264,9 +264,8 @@
 			html::escapeHTML($rs->post_title).'</a></li>';
 		}
-		
+
 		$res .= '</ul>'.($w->content_only ? '' : '</div>');
-		
+
 		return $res;
 	}
 }
-?>
