diff options
author | Andrew Dolgov <[email protected]> | 2021-04-09 14:02:54 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-04-09 14:02:54 +0300 |
commit | 46bbde30cc82a8d68947f0064731a8f6b4c151dd (patch) | |
tree | 2d6014b6e80c67f8c09e2b771d3b555458720809 | |
parent | 4942b25ab2b9a9c42f1048eca9f9b0891210d389 (diff) | |
parent | ffebb5f2c7ca4f45261c20d317ad0d90a07c547a (diff) |
Merge branch 'master' of git.tt-rss.org:fox/ttrss-api-resize
-rw-r--r-- | init.php | 14 |
1 files changed, 6 insertions, 8 deletions
@@ -10,9 +10,11 @@ class Api_Resize_Media extends Plugin { private $cache; function about() { - return array(1.0, + return array(null, "Resizes media on the fly (for API clients or web UI)", - "fox"); + "fox", + false, + "https://git.tt-rss.org/fox/ttrss-api-resize"); } function is_public_method($method) { @@ -174,10 +176,6 @@ class Api_Resize_Media extends Plugin { } } } else { - global $fetch_last_error; - global $fetch_last_error_code; - global $fetch_last_error_content; - if (function_exists("imagecreate") && !isset($_REQUEST["text"])) { $img = imagecreate(450, 75); @@ -188,7 +186,7 @@ class Api_Resize_Media extends Plugin { imagestring($img, 5, 5, 5, "Proxy request failed", $textcolor); imagestring($img, 5, 5, 30, truncate_middle($url, 46, "..."), $textcolor); - imagestring($img, 5, 5, 55, "HTTP Code: $fetch_last_error_code", $textcolor); + imagestring($img, 5, 5, 55, "HTTP Code: ".UrlHelper::$fetch_last_error_code, $textcolor); header("Content-type: image/png"); print imagepng($img); @@ -200,7 +198,7 @@ class Api_Resize_Media extends Plugin { http_response_code(400); print "Proxy request failed.\n". - "Fetch error $fetch_last_error ($fetch_last_error_code)\n". + "Fetch error ".UrlHelper::$fetch_last_error." (".UrlHelper::$fetch_last_error_code.")\n". "Requested URL: $url"; } } |