[pLog-svn] r6505 - plog/branches/lifetype-1.2/class/action
jondaley at devel.lifetype.net
jondaley at devel.lifetype.net
Thu Jun 5 08:32:07 EDT 2008
Author: jondaley
Date: 2008-06-05 08:32:07 -0400 (Thu, 05 Jun 2008)
New Revision: 6505
Modified:
plog/branches/lifetype-1.2/class/action/blogaction.class.php
Log:
validate stuff. though these validators don't do very much. see bug #1524
Modified: plog/branches/lifetype-1.2/class/action/blogaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/blogaction.class.php 2008-06-05 11:52:32 UTC (rev 6504)
+++ plog/branches/lifetype-1.2/class/action/blogaction.class.php 2008-06-05 12:32:07 UTC (rev 6505)
@@ -2,7 +2,10 @@
lt_include( PLOG_CLASS_PATH."class/action/action.class.php" );
lt_include( PLOG_CLASS_PATH."class/config/config.class.php" );
- lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/validator/usernamevalidator.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/validator/blognamevalidator.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/validator/domainvalidator.class.php" );
/**
* \ingroup Action
@@ -178,12 +181,32 @@
}
}
+ $val = new IntegerValidator();
$blogId = $this->_request->getValue( 'blogId' );
+ if( !$val->validate( $blogId ))
+ $blogId = "";
+
+ $val = new IntegerValidator();
+ $userId = $this->_request->getValue( 'userId' );
+ if( !$val->validate( $userId ))
+ $userId = "";
+
+ $val = new BlogNameValidator();
$blogName = $this->_request->getValue( 'blogName' );
- $userId = $this->_request->getValue( 'userId' );
+ if( !$val->validate( $blogName ))
+ $blogName = "";
+
+ $val = new UsernameValidator();
$userName = $this->_request->getValue( 'blogUserName' );
+ if( !$val->validate( $userName ))
+ $userName = "";
+
+ $val = new DomainValidator();
$blogDomain = $this->_request->getValue( 'blogDomain' );
+ if( !$val->validate( $blogDomain ))
+ $blogDomain = "";
+
// if there is a "blogId" parameter, it takes precedence over the
// "user" parameter.
if( !$blogId && !$blogName && !$blogDomain) {
@@ -372,7 +395,6 @@
*/
function _getPage()
{
- lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php");
// get the value from the request
$page = HttpVars::getRequestValue( "page" );
// but first of all, validate it
More information about the pLog-svn
mailing list