diff --git a/web/api/lib/Cake/Network/CakeResponse.php b/web/api/lib/Cake/Network/CakeResponse.php index 21dfd7b2e..982398e87 100644 --- a/web/api/lib/Cake/Network/CakeResponse.php +++ b/web/api/lib/Cake/Network/CakeResponse.php @@ -1168,6 +1168,9 @@ class CakeResponse { if ($modifiedSince) { $timeMatches = strtotime($this->modified()) === strtotime($modifiedSince); } + if (!isset($etagMatches, $timeMatches)) { + return false; + } $checks = compact('etagMatches', 'timeMatches'); if (empty($checks)) { return false; diff --git a/web/includes/Group.php b/web/includes/Group.php index df9fd611e..6c8338a55 100644 --- a/web/includes/Group.php +++ b/web/includes/Group.php @@ -95,13 +95,12 @@ class Group { } } } # end if options - $groups = array(); - $result = dbQuery($sql, $values); - $results = $result->fetchALL(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'Group'); - foreach ( $results as $row => $obj ) { - $groups[] = $obj; + + $results = dbFetchAll($sql, NULL, $values); + if ( $results ) { + return array_map( function($row){ return new Group($row); }, $results ); } - return $groups; + return array(); } # end find() public static function find_one($parameters = null, $options = null) {