[pLog-svn] r6529 - in plog/branches/lifetype-1.2/class: dao view/admin
mark at devel.lifetype.net
mark at devel.lifetype.net
Mon Jun 9 06:34:05 EDT 2008
Author: mark
Date: 2008-06-09 06:34:05 -0400 (Mon, 09 Jun 2008)
New Revision: 6529
Modified:
plog/branches/lifetype-1.2/class/dao/blogs.class.php
plog/branches/lifetype-1.2/class/view/admin/adminsiteblogslistview.class.php
Log:
1. We should not use HttpVars::getRequestValue() in any situation, unless we need the raw request.
2. We can use $this->_request->getValue() or $this->_request->getFilteredValue() in $view. It better to use getFilteredValue(), since there is no registerFiledValidator in $view. So, we can get a cleaned input data from getFilteredValue() function.
3. Fix a sql error of blogs.
Modified: plog/branches/lifetype-1.2/class/dao/blogs.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/blogs.class.php 2008-06-09 10:21:48 UTC (rev 6528)
+++ plog/branches/lifetype-1.2/class/dao/blogs.class.php 2008-06-09 10:34:05 UTC (rev 6529)
@@ -209,10 +209,9 @@
$page = -1,
$itemsPerPage = DEFAULT_ITEMS_PER_PAGE )
{
- $statusCond = "";
+ $where = "";
if( $status != BLOG_STATUS_ALL )
- $statusCond = "status = '".Db::qstr($status)."'";
- $where = $statusCond;
+ $where = "status = '".Db::qstr($status)."'";
if( $blogCategoryId != ALL_BLOG_CATEGORIES ) {
if( $where != "" )
@@ -220,12 +219,10 @@
$where .= " blog_category_id = '".Db::qstr($blogCategoryId)."'";
}
- $searchCond = "";
if( $searchTerms != "" ){
- $searchCond = $this->getSearchConditions( $searchTerms );
if( $where != "" )
$where .= " AND ";
- $where .= $searchCond;
+ $where .= $this->getSearchConditions( $searchTerms );
}
if( $where != "" )
Modified: plog/branches/lifetype-1.2/class/view/admin/adminsiteblogslistview.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/view/admin/adminsiteblogslistview.class.php 2008-06-09 10:21:48 UTC (rev 6528)
+++ plog/branches/lifetype-1.2/class/view/admin/adminsiteblogslistview.class.php 2008-06-09 10:34:05 UTC (rev 6529)
@@ -36,7 +36,7 @@
*/
function getStatusFromRequest()
{
- $status = HttpVars::getRequestValue( "status" );
+ $status = $this->_request->getFilteredValue( "status", new HtmlFilter());
// validate the value
$val = new IntegerValidator();
More information about the pLog-svn
mailing list