Skip to content
Snippets Groups Projects
Commit ce9fc6c8 authored by Jared Hancock's avatar Jared Hancock
Browse files

avatar: Serve mystery Oscar on bad states

parent 5919b640
No related branches found
No related tags found
No related merge requests found
......@@ -152,10 +152,10 @@ class RandomAvatar {
}
function makeAvatar($uid) {
if (!extension_loaded('gd'))
$sprite = self::$sprites[$this->mode];
if (!$sprite || !is_readable(ROOT_DIR . $sprite['file']) || !extension_loaded('gd'))
Http::redirect(ROOT_PATH.'images/mystery-oscar.png');
$sprite = self::$sprites[$this->mode];
$source = imagecreatefrompng(ROOT_DIR . $sprite['file']);
$grid = $sprite['grid'];
$avatar = imagecreatetruecolor($grid, $grid);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment