Skip to content

Commit

Permalink
Fixed bug where CategoryModel::JoinUserData() can pickup/pollute Gdn:…
Browse files Browse the repository at this point in the history
…:SQL().
  • Loading branch information
tburry committed Oct 23, 2011
1 parent d9876de commit 2357a65
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion applications/vanilla/models/class.categorymodel.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,11 @@ public static function JoinCategories(&$Data, $Column = 'CategoryID', $Options =
*/
public static function JoinUserData(&$Categories, $AddUserCategory = TRUE) {
if ($AddUserCategory) {
$SQL = clone Gdn::SQL();
$SQL->Reset();

if (Gdn::Session()->UserID) {
$UserData = Gdn::SQL()->GetWhere('UserCategory', array('UserID' => Gdn::Session()->UserID))->ResultArray();
$UserData = $SQL->GetWhere('UserCategory', array('UserID' => Gdn::Session()->UserID))->ResultArray();
$UserData = Gdn_DataSet::Index($UserData, 'CategoryID');
} else
$UserData = array();
Expand Down

0 comments on commit 2357a65

Please sign in to comment.