]> git.wh0rd.org - tt-rss.git/commitdiff
af_zz_imgproxy: truncate url in error png
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 13 Feb 2017 12:49:41 +0000 (15:49 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Mon, 13 Feb 2017 12:49:41 +0000 (15:49 +0300)
plugins/af_zz_imgproxy/init.php

index 07177bb7c14e5c67987b493fd51b5686f1f8806a..0bd14cab95e61917b3da01a1e73cb7a04ac01a7a 100644 (file)
@@ -78,15 +78,15 @@ class Af_Zz_ImgProxy extends Plugin {
                                global $fetch_last_error_content;
 
                                if (function_exists("imagecreate")) {
-                                       $img = imagecreate(400, 75);
+                                       $img = imagecreate(450, 75);
 
                                        $bg = imagecolorallocate($img, 255, 255, 255);
                                        $textcolor = imagecolorallocate($img, 255, 0, 0);
 
-                                       imagerectangle($img, 0, 0, 400-1, 75-1, $textcolor);
+                                       imagerectangle($img, 0, 0, 450-1, 75-1, $textcolor);
 
                                        imagestring($img, 5, 5, 5, "Proxy request failed", $textcolor);
-                                       imagestring($img, 5, 5, 30, $url, $textcolor);
+                                       imagestring($img, 5, 5, 30, truncate_middle($url, 46, "..."), $textcolor);
                                        imagestring($img, 5, 5, 55, "HTTP Code: $fetch_last_error_code", $textcolor);
 
                                        header("Content-type: image/png");