diff --git a/inc/mod/pages.php b/inc/mod/pages.php index 141056b2..acd8e0dc 100644 --- a/inc/mod/pages.php +++ b/inc/mod/pages.php @@ -160,7 +160,7 @@ function mod_dashboard() { $latest = false; } - setcookie('update', serialize($latest), time() + $config['check_updates_time'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, $_SERVER['HTTPS'], true); + setcookie('update', serialize($latest), time() + $config['check_updates_time'], $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']), true); } if ($latest) diff --git a/js/no-animated-gif.js b/js/no-animated-gif.js index cfdf757b..36d48954 100644 --- a/js/no-animated-gif.js +++ b/js/no-animated-gif.js @@ -13,7 +13,17 @@ function unanimate_gif(e) { $(e).parent().prepend(c); c.attr('width', $(e).width()); c.attr('height',$(e).height()); - c[0].getContext('2d').drawImage(e, 0, 0, $(e).width(), $(e).height()); + function draw_image() { + c[0].getContext('2d').drawImage(e, 0, 0, $(e).width(), $(e).height()) + }; + + // Fix drawing image before loaded. Note that Chrome needs to check .complete because load() is NOT called if loaded from cache. + if (!e.complete) { + e.onload = draw_image; + } else { + draw_image(); + } + $(e).hide(); }