$group_guid = get_input('group_guid');
$group = get_entity($group_guid);
-// If is the same eTag, content didn't changed.
-$eTag = $group->icontime . $group_guid;
-if (trim($_SERVER['HTTP_IF_NONE_MATCH']) == $eTag) {
+// If is the same ETag, content didn't changed.
+$etag = $group->icontime . $group_guid;
+if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) {
header("HTTP/1.1 304 Not Modified");
exit;
}
$size = strtolower(get_input('size'));
-if (!in_array($size,array('large','medium','small','tiny','master','topbar')))
+if (!in_array($size, array('large', 'medium', 'small', 'tiny', 'master', 'topbar')))
$size = "medium";
$success = false;
header("Pragma: public");
header("Cache-Control: public");
header("Content-Length: " . strlen($contents));
-header("ETag: $eTag");
+header("ETag: $etag");
echo $contents;
$last_cache = (int)$_GET['lastcache']; // icontime
$guid = (int)$_GET['guid'];
-// If is the same eTag, content didn't changed.
-$eTag = $last_cache . $guid;
-if (trim($_SERVER['HTTP_IF_NONE_MATCH']) == $eTag) {
+// If is the same ETag, content didn't changed.
+$etag = $last_cache . $guid;
+if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && trim($_SERVER['HTTP_IF_NONE_MATCH']) == $etag) {
header("HTTP/1.1 304 Not Modified");
exit;
}
header("Pragma: public");
header("Cache-Control: public");
header("Content-Length: " . strlen($contents));
- header("ETag: $eTag");
+ header("ETag: $etag");
// this chunking is done for supposedly better performance
$split_string = str_split($contents, 1024);
foreach ($split_string as $chunk) {