[pLog-svn] r6435 - plog/branches/lifetype-1.2/class/dao

mark at devel.lifetype.net mark at devel.lifetype.net
Sat May 3 09:30:15 EDT 2008


Author: mark
Date: 2008-05-03 09:30:14 -0400 (Sat, 03 May 2008)
New Revision: 6435

Modified:
   plog/branches/lifetype-1.2/class/dao/articlecategories.class.php
   plog/branches/lifetype-1.2/class/dao/model.class.php
Log:
Fixed a serious bug about the search term. It will show other user's article category. :(

Modified: plog/branches/lifetype-1.2/class/dao/articlecategories.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/articlecategories.class.php	2008-05-02 03:24:39 UTC (rev 6434)
+++ plog/branches/lifetype-1.2/class/dao/articlecategories.class.php	2008-05-03 13:30:14 UTC (rev 6435)
@@ -100,7 +100,7 @@
 		 */
 		function getSearchConditions( $searchTerms )
 		{
-			return( "name LIKE '%".Db::qstr($searchTerms)."%' OR description LIKE '%".Db::qstr($searchTerms)."%'" );
+			return( "(name LIKE '%".Db::qstr($searchTerms)."%' OR description LIKE '%".Db::qstr($searchTerms)."%')" );
 		}
         
         /**

Modified: plog/branches/lifetype-1.2/class/dao/model.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/model.class.php	2008-05-02 03:24:39 UTC (rev 6434)
+++ plog/branches/lifetype-1.2/class/dao/model.class.php	2008-05-03 13:30:14 UTC (rev 6435)
@@ -268,7 +268,7 @@
 					// get the table-dependent search string
 					$search = $this->getSearchConditions( $searchTerms );
 					// add the search terms, if any
-					if( $where ) $where .= " AND $search";
+					if( $where ) $where .= " AND ( $search )";
 					else
 						if( $search) $where = " WHERE ".$search;
 					// remove the last 'AND' in case it's the last thing in the string



More information about the pLog-svn mailing list