[pLog-svn] r6138 - in plog/trunk: class/action class/locale class/security templates/rss templates/standard

mark at devel.lifetype.net mark at devel.lifetype.net
Wed Jan 2 10:57:30 EST 2008


Author: mark
Date: 2008-01-02 10:57:29 -0500 (Wed, 02 Jan 2008)
New Revision: 6138

Modified:
   plog/trunk/class/action/action.class.php
   plog/trunk/class/locale/locale.class.php
   plog/trunk/class/security/bayesianfilter.class.php
   plog/trunk/class/security/pipelinerequest.class.php
   plog/trunk/templates/rss/atom.template
   plog/trunk/templates/standard/footer.template
Log:
Merge from LifeType 1.2 development branches rev. 6060:6092

Modified: plog/trunk/class/action/action.class.php
===================================================================
--- plog/trunk/class/action/action.class.php	2008-01-02 15:44:48 UTC (rev 6137)
+++ plog/trunk/class/action/action.class.php	2008-01-02 15:57:29 UTC (rev 6138)
@@ -218,14 +218,7 @@
 				// this is the normal processing for html views
 				$this->_view = $this->_validationErrorView;
 				$this->_view->setError( true );
-				
-				// and  export all the data to the view so that it can be reused in the error view
-				$fieldValues = $this->_form->getFieldValues();
-				foreach( $fieldValues as $fieldName => $fieldValue ) {
-					$this->_view->setValue( "$fieldName", $fieldValue );
-				}				
-				
-				$this->setCommonData();
+				$this->setCommonData( true );
 			}
 	
 			return true;
@@ -345,4 +338,4 @@
 			return( true );
 		}			
     }
-?>
\ No newline at end of file
+?>

Modified: plog/trunk/class/locale/locale.class.php
===================================================================
--- plog/trunk/class/locale/locale.class.php	2008-01-02 15:44:48 UTC (rev 6137)
+++ plog/trunk/class/locale/locale.class.php	2008-01-02 15:57:29 UTC (rev 6138)
@@ -473,7 +473,8 @@
 		 * <li>%S	seconds</li>
 		 * <li>%y	2-digit year representation</li>
 		 * <li>%Y	4-digit year representation</li>
-		 * <li>%O   Difference to Greenwich time (GMT) in hours</li>
+		 * <li>%O   Difference to Greenwich time (GMT) in hours, format will be +0000</li>
+		 * <li>%G   Difference to Greenwich time (GMT) in hours, format will be +00:00</li>
 		 * <li>%%	the '%' character
          * </ul>
          * (these have been added by myself and are therefore incompatible with php)<ul>
@@ -588,6 +589,14 @@
 				
 				$text = str_replace( "%O", sprintf( "%s%02d%02d", $timeZoneDirection, $timeZoneHours, $timeZoneMins ), $text );				
 			}					
+			if( strpos( $text, "%G" ) !== FALSE ) {
+	            // Now convert the time zone seconds to hours and minutes
+	            $timeZoneHours = intval( abs($timeZoneSec) / 3600 );
+	            $timeZoneMins = intval(( abs($timeZoneSec) % 3600 ) / 60 );
+	            $timeZoneDirection = ($timeZoneSec < 0 ) ? "-" : "+";				
+				
+				$text = str_replace( "%G", sprintf( "%s%02d:%02d", $timeZoneDirection, $timeZoneHours, $timeZoneMins ), $text );				
+			}
 			if( strpos( $text, "%%" ) !== FALSE ) {
 				$text = str_replace( "%%", "%", $text );				
 			}
@@ -651,6 +660,7 @@
 		 * <li>%y	2-digit year representation</li>
 		 * <li>%Y	4-digit year representation</li>
 		 * <li>%O   Difference to Greenwich time (GMT) in hours (Will always be +0000)</li>
+		 * <li>%G   Difference to Greenwich time (GMT) in hours (Will always be +00:00)</li>
 		 * <li>%%	the '%' character
          * </ul>
          * (these have been added by myself and are therefore incompatible with php)<ul>
@@ -764,6 +774,9 @@
 			if( strpos( $text, "%O" ) !== FALSE ) {
 				$text = str_replace( "%O", "+0000", $text );				
 			}					
+			if( strpos( $text, "%G" ) !== FALSE ) {
+				$text = str_replace( "%G", "+00:00", $text );				
+			}					
 			if( strpos( $text, "%%" ) !== FALSE ) {
 				$text = str_replace( "%%", "%", $text );
 			}

Modified: plog/trunk/class/security/bayesianfilter.class.php
===================================================================
--- plog/trunk/class/security/bayesianfilter.class.php	2008-01-02 15:44:48 UTC (rev 6137)
+++ plog/trunk/class/security/bayesianfilter.class.php	2008-01-02 15:57:29 UTC (rev 6138)
@@ -59,30 +59,40 @@
                 $result = new PipelineResult();
                 return $result;
             }
-			
-            			
-            
+           
             // if it's a trackback, the data is in another place...
             $parentId = "";
             $isTrackback = ($request->getValue( "op" ) == "AddTrackback");
             if( $isTrackback ) {
-                $commentText = $request->getValue( "excerpt" );
-                $commentTopic = $request->getValue( "title" );
-                $articleId = $request->getValue( "id" );
-                // that's all we can get from a trackback...
-                $userName = $request->getValue( "blog_name" );
-                $userUrl = $request->getValue( "url" );
-                $userEmail = $request->getValue( "" );
+                $f = new HtmlFilter();
+                $userName = $request->getFilteredValue( "blog_name", $f );
+                $userEmail = $request->getFilteredValue( "", $f );
+                $commentTopic = $request->getFilteredValue( "title", $f );
+                $commentText = $request->getFilteredValue( "excerpt", $f );
+
+    			$f = new HtmlFilter();
+    			$f->addFilter( new UrlConverter());
+    			$userUrl = $request->getFilteredValue( "url", $f );
+
+                $articleId = (int) $request->getValue( "id" );
             }
             else {
                 // or else let's assume that we're dealing with a comment
-                $commentText = $request->getValue( "commentText" );
-                $commentTopic = $request->getValue( "commentTopic" );
-                $userName = $request->getValue( "userName" );
-                $userEmail = $request->getValue( "userEmail" );
-                $userUrl = $request->getValue( "userUrl" );
-                $articleId = $request->getValue( "articleId" );
-                $parentId  = $request->getValue( "parentId" );          
+                $f = new HtmlFilter();
+                $userName = $request->getFilteredValue( "userName", $f );
+                $userEmail = $request->getFilteredValue( "userEmail", $f );
+                $commentTopic = $request->getFilteredValue( "commentTopic", $f );
+
+    			$f = new HtmlFilter();
+    			$f->addFilter( new UrlConverter());
+    			$userUrl = $request->getFilteredValue( "userUrl", $f );
+
+    			$f = new AllowedHtmlFilter();
+    			$f->addFilter( new XhtmlizeFilter());
+    			$commentText = $request->getFilteredValue( "commentText", $f );
+
+                $articleId = (int) $request->getValue( "articleId" );
+                $parentId  = (int) $request->getValue( "parentId" );
             }
 
 			// the two checks below are duplicating some of the code in AddCommentAction

Modified: plog/trunk/class/security/pipelinerequest.class.php
===================================================================
--- plog/trunk/class/security/pipelinerequest.class.php	2008-01-02 15:44:48 UTC (rev 6137)
+++ plog/trunk/class/security/pipelinerequest.class.php	2008-01-02 15:57:29 UTC (rev 6138)
@@ -8,7 +8,7 @@
      * such as the incoming HTTP request and a reference to the BlogInfo object
      * of the blog that is executing the Pipeline.
      */
-	class PipelineRequest  
+	class PipelineRequest
 	{
 
     	var $_httpRequest;
@@ -24,13 +24,13 @@
          */
         function PipelineRequest( $httpRequest, $blogInfo, $rejected = false )
         {
-        	
 
+
             if( is_array($httpRequest))
-            	$this->_httpRequest = new Properties( $httpRequest );
+            	$this->_httpRequest = new Request( $httpRequest );
             else
         		$this->_httpRequest  = $httpRequest;
-                
+
             $this->_blogInfo         = $blogInfo;
             $this->_requestRejected  = $rejected;
         }
@@ -51,15 +51,15 @@
         {
         	return $this->_httpRequest;
         }
-        
+
         /**
-        * @return Returns a boolean that indicates if this pipeline request has 
+        * @return Returns a boolean that indicates if this pipeline request has
         * already been rejected
         */
         function getRejectedState()
         {
         	return $this->_requestRejected;
         }
-        
+
     }
 ?>

Modified: plog/trunk/templates/rss/atom.template
===================================================================
--- plog/trunk/templates/rss/atom.template	2008-01-02 15:44:48 UTC (rev 6137)
+++ plog/trunk/templates/rss/atom.template	2008-01-02 15:57:29 UTC (rev 6138)
@@ -8,7 +8,7 @@
 <link rel="alternate" type="text/html" href="{$url->blogLink()}" /> 
 {if $posts}
 	{assign var="newestDate" value=$posts[0]->getDateObject()} 
-	<modified>{$locale->formatDate($newestDate, "%Y-%m-%dT%H:%M:%S%O", $blog)}</modified> 
+	<modified>{$locale->formatDate($newestDate, "%Y-%m-%dT%H:%M:%S%G", $blog)}</modified> 
 {/if}
 <tagline>{$blog->getAbout()|escape}</tagline> 
 <generator url="http://www.lifetype.net/" version="1.2">LifeType</generator> 
@@ -20,9 +20,9 @@
  <title>{$post->getTopic()|escape}</title> 
  <link rel="alternate" type="text/html" href="{$url->postPermalink($post)}" /> 
  {assign var="postDate" value=$post->getDateObject()} 
- <modified>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S%O", $blog)}</modified> 
- <issued>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S%O", $blog)}</issued> 
- <created>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S%O", $blog)}</created> 
+ <modified>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S%G", $blog)}</modified> 
+ <issued>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S%G", $blog)}</issued> 
+ <created>{$locale->formatDate($postDate, "%Y-%m-%dT%H:%M:%S%G", $blog)}</created> 
  <summary type="text/plain">{$post->getText()|strip_tags|truncate:200:" ..."|escape:"html"}</summary> 
  <author> 
   {assign var="postOwner" value=$post->getUserInfo()} 

Modified: plog/trunk/templates/standard/footer.template
===================================================================
--- plog/trunk/templates/standard/footer.template	2008-01-02 15:44:48 UTC (rev 6137)
+++ plog/trunk/templates/standard/footer.template	2008-01-02 15:57:29 UTC (rev 6138)
@@ -2,11 +2,11 @@
 
 </div>
 
-<div id="Menu">	
+<div id="Menu">
 {assign var=blogOwner value=$blog->getOwnerInfo()}
 {assign var=AboutMyself value=$blogOwner->getAboutMyself()}
 {if $blogOwner->hasPicture() && $AboutMyself}
-  
+
   	<h2>{$locale->tr("about_myself")}</h2>
   	<div id="AboutMyself">
   	{assign var=picture value=$blogOwner->getPicture()}
@@ -29,16 +29,16 @@
     	<li><a title="{$locale->tr("main")}" href="{$url->blogLink()}">{$locale->tr("main")}</a></li>
     	<li><a title="{$locale->tr("archives")}" href="{$url->templatePage("archives")}">{$locale->tr("archives")}</a></li>
     	<li><a title="{$locale->tr("albums")}" href="{$url->albumLink()}">{$locale->tr("albums")}</a></li>
-    	
+
     	 {foreach name=mylinkscategories from=$mylinkscategories item=panel_linkcategory}
 {if $smarty.foreach.mylinkscategories.first}
-   
+
 <li><a title="{$locale->tr("links")}" href="{$url->templatePage("links")}">{$locale->tr("links")}</a></li>{/if}
     	{/foreach}
     	<li><a title="{$locale->tr("admin")}" href="{$url->getAdminUrl()}">{$locale->tr("admin")}</a></li>
     	</ul>
     	</div>
-    	
+
     	<h2>{$locale->tr("search")}</h2>
 	<div id="Search">
 	<form id="search_form" method="post" action="{$url->getIndexUrl()}">
@@ -46,16 +46,16 @@
 	<label for="searchTerms"><input type="text" id="searchTerms" name="searchTerms" value="" /></label>
 	<input type="submit" name="Search" value="{$locale->tr("search_s")}" class="button" />
 	<input type="hidden" name="op" value="Search" />
-	<input type="hidden" name="blogId" value="{$blog->getId()}" />   
+	<input type="hidden" name="blogId" value="{$blog->getId()}" />
 	</fieldset>
 	</form>
-	</div> 
-	
+	</div>
+
 	<h2>{$locale->tr("calendar")}</h2>
     	<div id="Calendar">
     		{$calendar}
-    	</div>	
-  
+    	</div>
+
   	<h2>{$locale->tr("recently")}</h2>
     	<div id="Recently">
     	<ul>
@@ -64,7 +64,7 @@
     		{/foreach}
     	</ul>
    	</div>
-    
+
  	<h2>{$locale->tr("categories")}</h2>
     	<div id="Categories">
     	<ul>
@@ -73,19 +73,19 @@
    		{/foreach}
   	</ul>
   	</div>
-  
+
   	<h2>{$locale->tr("syndicate")}</h2>
     	<div id="Syndicate">
     	<ul>
     	<li><a title="RSS 0.90" href="{$url->rssLink("rss090")}">RSS 0.90</a></li>
     	<li><a title="RSS 1.0" href="{$url->rssLink("rss10")}">RSS 1.0</a></li>
     	<li><a title="RSS 2.0" href="{$url->rssLink("rss20")}">RSS 2.0</a></li>
-    	<li><a title="Atom" href="{$url->rssLink("rss20")}">Atom</a></li>
+    	<li><a title="Atom" href="{$url->rssLink("atom")}">Atom</a></li>
     	</ul>
     	</div>
 </div>
 
-<div class="clearer">&nbsp;</div> 
+<div class="clearer">&nbsp;</div>
 
 
 



More information about the pLog-svn mailing list