$result = $query->executeQuery();
$row = $result->fetch();
if (!$row) {
+ $result->closeCursor();
return false;
}
$row['etag'] = '"' . $row['etag'] . '"';
if ($modified) {
$row['size'] = strlen($row['carddata']);
}
+ $result->closeCursor();
return $row;
}
*/
private function readBlob($cardData, &$modified = false) {
if (is_resource($cardData)) {
- $cardData = stream_get_contents($cardData);
+ $stringCardData = stream_get_contents($cardData);
+ if ($stringCardData === false) {
+ return '';
+ }
+ fclose($cardData);
+ $cardData = $stringCardData;
}
// Micro optimisation