Skip to content
Snippets Groups Projects
Commit a52de115 authored by Chris Burgess's avatar Chris Burgess
Browse files

Issue CRM-14394. Check that $path is not NULL, and that the file exists.

parent 32047f07
Branches
Tags
No related merge requests found
......@@ -773,10 +773,12 @@ ORDER BY civicrm_custom_group.weight,
list($path) = CRM_Core_BAO_File::path($fileDAO->id, $entityId,
NULL, NULL
);
list($imageWidth, $imageHeight) = getimagesize($path);
list($imageThumbWidth, $imageThumbHeight) = CRM_Contact_BAO_Contact::getThumbSize($imageWidth, $imageHeight);
$customValue['imageThumbWidth'] = $imageThumbWidth;
$customValue['imageThumbHeight'] = $imageThumbHeight;
if ($path && file_exists($path)) {
list($imageWidth, $imageHeight) = getimagesize($path);
list($imageThumbWidth, $imageThumbHeight) = CRM_Contact_BAO_Contact::getThumbSize($imageWidth, $imageHeight);
$customValue['imageThumbWidth'] = $imageThumbWidth;
$customValue['imageThumbHeight'] = $imageThumbHeight;
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment