Do not set avatar if fetched remote avatar is to large
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 20 Apr 2015 12:33:27 +0000 (14:33 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 20 Apr 2015 12:33:27 +0000 (14:33 +0200)
wcfsetup/install/files/lib/data/user/avatar/UserAvatarAction.class.php

index a36e8c9ae7d49d251f404e4252c16c1dacce7d0d..62f1ed3870f0613b94e77b05a8ed9ba415f0dd8c 100644 (file)
@@ -192,7 +192,10 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
                        @unlink($filename);
                        $filename = $newFilename;
                }
-               catch (\Exception $e) { /* ignore errors */ }
+               catch (\Exception $e) {
+                       @unlink($filename);
+                       return;
+               }
                
                $imageData = getimagesize($filename);
                $tmp = parse_url($this->parameters['url']);