[pLog-svn] r6476 - plog/branches/lifetype-1.2/class/action

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Sat May 24 15:16:46 EDT 2008


Author: jondaley
Date: 2008-05-24 15:16:46 -0400 (Sat, 24 May 2008)
New Revision: 6476

Modified:
   plog/branches/lifetype-1.2/class/action/viewresourceaction.class.php
Log:
deny html in names.  removed unused validation code, the parent::validate would have already caught it

Modified: plog/branches/lifetype-1.2/class/action/viewresourceaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/viewresourceaction.class.php	2008-05-24 19:15:45 UTC (rev 6475)
+++ plog/branches/lifetype-1.2/class/action/viewresourceaction.class.php	2008-05-24 19:16:46 UTC (rev 6476)
@@ -25,38 +25,25 @@
 		function ViewResourceAction( $actionInfo, $request )
         {
 			$this->BlogAction( $actionInfo, $request );
-			
 			$this->registerFieldValidator( "resId", new IntegerValidator(), true );
-			$this->registerFieldValidator( "resource", new StringValidator(), true );
+			$this->registerFieldValidator( "resource", new StringValidator( false ), true );
 			$this->registerFieldValidator( "albumId", new IntegerValidator(), true );
-			$this->registerFieldValidator( "albumName", new StringValidator(), true );
+			$this->registerFieldValidator( "albumName", new StringValidator( false ), true );
 			
-			$this->setValidationErrorView( new ErrorView( $this->_blogInfo, "error_fetching_resource" ));			
+			$this->setValidationErrorView( new ErrorView( $this->_blogInfo, "error_fetching_resource" ));
         }
 
-        // checks that the articleId is valid
         function validate()
         {
 			if( !parent::validate())
 				return false;
-	
+
         	$this->_resourceId = $this->_request->getValue( "resId" );
             $this->_resourceName = $this->_request->getValue( "resource" );
 			$this->_albumId = $this->_request->getValue( "albumId" );
 			$this->_albumName = $this->_request->getValue( "albumName" );
-            
-            if( $this->_resourceName == "" ) {
-            	$validator = new IntegerValidator();
-                // if the information is not correct, we better show a message and quit
-                if( !$validator->validate( $this->_resourceId )) {
-                	$this->_view = new ErrorView( $this->_blogInfo, "error_incorrect_resource_id" );
-                    $this->setCommonData();
-
-                    return false;
-                }
-            }
 			
-			// if no album id parameter in the url, forget about the whole thing
+			// if no album parameter in the url, forget about the whole thing
 			if( $this->_albumId == "" && $this->_albumName == "")
 				$this->_albumId = -1;
 



More information about the pLog-svn mailing list