Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/favicon/PhabricatorFaviconRef.php
| Show First 20 Lines • Show All 241 Lines • ▼ Show 20 Lines | final class PhabricatorFaviconRef extends Phobject { | ||||
| } | } | ||||
| private function newCompositedFavicon($template) { | private function newCompositedFavicon($template) { | ||||
| $dst_w = $this->getWidth(); | $dst_w = $this->getWidth(); | ||||
| $dst_h = $this->getHeight(); | $dst_h = $this->getHeight(); | ||||
| $src_w = $template['width']; | $src_w = $template['width']; | ||||
| $src_h = $template['height']; | $src_h = $template['height']; | ||||
| try { | |||||
| $template_data = $template['file']->loadFileData(); | $template_data = $template['file']->loadFileData(); | ||||
| } catch (Exception $ex) { | |||||
| // In rare cases, we can end up with a corrupted or inaccessible file. | |||||
| // If we do, just give up: otherwise, it's impossible to get pages to | |||||
| // generate and not obvious how to fix it. | |||||
| return null; | |||||
amckinley: Maybe create a setup warning? I suppose this case is pretty rare, but it would otherwise be a… | |||||
| } | |||||
| if (!function_exists('imagecreatefromstring')) { | if (!function_exists('imagecreatefromstring')) { | ||||
| return $template_data; | return $template_data; | ||||
| } | } | ||||
| $src = @imagecreatefromstring($template_data); | $src = @imagecreatefromstring($template_data); | ||||
| if (!$src) { | if (!$src) { | ||||
| return $template_data; | return $template_data; | ||||
| ▲ Show 20 Lines • Show All 189 Lines • Show Last 20 Lines | |||||
Maybe create a setup warning? I suppose this case is pretty rare, but it would otherwise be a mystery as to how to recover a deleted favicon.