Log exceptions in ImageProxyAction
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 16 Aug 2016 18:11:28 +0000 (20:11 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Tue, 16 Aug 2016 18:14:57 +0000 (20:14 +0200)
wcfsetup/install/files/lib/action/ImageProxyAction.class.php

index f1020880b7cee7e8d5024aa6960c62c1cb0a9c1e..0c2bd92a0681ca0900e62be56df764906b156be3 100644 (file)
@@ -56,8 +56,13 @@ class ImageProxyAction extends AbstractAction {
                        
                        // download image
                        if (!file_exists($fileLocation)) {
-                               $request = new HTTPRequest($url);
-                               $request->execute();
+                               try {
+                                       $request = new HTTPRequest($url);
+                                       $request->execute();
+                               }
+                               catch (SystemException $e) {
+                                       throw new IllegalLinkException();
+                               }
                                $image = $request->getReply()['body'];
                                
                                // check if image is linked
@@ -79,9 +84,11 @@ class ImageProxyAction extends AbstractAction {
                        exit;
                }
                catch (SystemException $e) {
+                       \wcf\functions\exception\logThrowable($e);
                        throw new IllegalLinkException();
                }
                catch (CryptoException $e) {
+                       \wcf\functions\exception\logThrowable($e);
                        throw new IllegalLinkException();
                }
        }