diff options
author | zotlabs <mike@macgirvin.com> | 2017-01-16 18:31:09 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-16 18:31:09 +1100 |
commit | 8478ecc6755eefb1977566c8f4bbbd603d5b37db (patch) | |
tree | 5678c95243ead980b35c36eb2d9e2f806eb31829 /include | |
parent | e5662dc89367dc70f6a07282c807807261503726 (diff) | |
parent | a36d74dad5dbc080007ba85d841ee0f74c9c919d (diff) | |
download | volse-hubzilla-8478ecc6755eefb1977566c8f4bbbd603d5b37db.tar.gz volse-hubzilla-8478ecc6755eefb1977566c8f4bbbd603d5b37db.tar.bz2 volse-hubzilla-8478ecc6755eefb1977566c8f4bbbd603d5b37db.zip |
Merge pull request #645 from git-marijus/dev
do not choke if photo_factory() returns null
Diffstat (limited to 'include')
-rw-r--r-- | include/network.php | 4 | ||||
-rw-r--r-- | include/photo/photo_driver.php | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/include/network.php b/include/network.php index 451ce12a1..d571ec2ce 100644 --- a/include/network.php +++ b/include/network.php @@ -714,6 +714,10 @@ function scale_external_images($s, $include_link = true, $scale_replace = false) if($i['success']) { $ph = photo_factory($i['body'], $type); + + if(! is_object($ph)) + continue; + if($ph->is_valid()) { $orig_width = $ph->getWidth(); $orig_height = $ph->getHeight(); diff --git a/include/photo/photo_driver.php b/include/photo/photo_driver.php index af4fd0a30..c8b3c3782 100644 --- a/include/photo/photo_driver.php +++ b/include/photo/photo_driver.php @@ -11,8 +11,10 @@ function photo_factory($data, $type = null) { 'image/svg+xml' ); - if($type && in_array(strtolower($type),$unsupported_types)) + if($type && in_array(strtolower($type),$unsupported_types)) { + logger('photo_factory: unsupported image type'); return null; + } $ignore_imagick = get_config('system', 'ignore_imagick'); |