Hi,
This message is more for fox but I think it's better to send in public.
This plugin is nice, but has one missing ability, maybe it will be added later as it's really new: it does not proxy images in attachments (div.cdmIntermediate).
It requires to add a new hook to be used in classes/feeds.php around lines 717-722.
As I don't know the code, I would probably forget something if I edit tt-rss and the plugin, but with a bit more information, I would be ok to help (but most of the work is done anyway).
Thanks for reading this.
About af_zz_imgproxy (Load insecure images via built-in proxy)
-
- Bear Rating Trainee
- Posts: 6
- Joined: 06 Jan 2016, 14:38
- fox
- ^ me reading your posts ^
- Posts: 6318
- Joined: 27 Aug 2005, 22:53
- Location: Saint-Petersburg, Russia
- Contact:
Re: About af_zz_imgproxy (Load insecure images via built-in proxy)
i don't think i have any feeds like that, can you post an example?
e: i think it's PluginHost::HOOK_RENDER_ENCLOSURE although maybe it would be worth it to add a hook for enclosure urls only
e2: no idea if this works https://tt-rss.org/gitlab/fox/tt-rss/co ... d57a0c7cd7
e: i think it's PluginHost::HOOK_RENDER_ENCLOSURE although maybe it would be worth it to add a hook for enclosure urls only
e2: no idea if this works https://tt-rss.org/gitlab/fox/tt-rss/co ... d57a0c7cd7
-
- Bear Rating Trainee
- Posts: 6
- Joined: 06 Jan 2016, 14:38
Re: About af_zz_imgproxy (Load insecure images via built-in proxy)
Well...
(hook_render_enclosure vs hook_enclosure_entry, and maybe url vs content_url)
Code: Select all
14:29:22.782 "Invalid object received: <br />
<b>Fatal error</b>: Uncaught Error: Call to undefined method Af_Zz_ImgProxy::hook_render_enclosure() in /srv/http/elou.world/documentroot/tt-rss/include/functions2.php:1948
Stack trace:
#0 /srv/http/elou.world/documentroot/tt-rss/classes/feeds.php(720): format_article_enclosures('2445', false, '<p>Millions of ...', false)
#1 /srv/http/elou.world/documentroot/tt-rss/classes/feeds.php(938): Feeds->format_headlines_list(3, '', 'adaptive', 30, true, '', 0, '', false, true, '', false)
#2 /srv/http/elou.world/documentroot/tt-rss/backend.php(123): Feeds->view()
#3 {main}
thrown in <b>/srv/http/elou.world/documentroot/tt-rss/include/functions2.php</b> on line <b>1948</b><br />
"1 tt-rss:408:29
headlines_callback2() tt-rss:408
viewfeed/_viewfeed_timeout</<.onComplete() tt-rss:344
Ajax.Request<.respondToReadyState() prototype.js:1827
Ajax.Request<.onStateChange() prototype.js:1756
(hook_render_enclosure vs hook_enclosure_entry, and maybe url vs content_url)
- fox
- ^ me reading your posts ^
- Posts: 6318
- Joined: 27 Aug 2005, 22:53
- Location: Saint-Petersburg, Russia
- Contact:
Re: About af_zz_imgproxy (Load insecure images via built-in proxy)
should be better now, i think
-
- Bear Rating Trainee
- Posts: 6
- Joined: 06 Jan 2016, 14:38
Re: About af_zz_imgproxy (Load insecure images via built-in proxy)
Yes that works, just that in the Attachements menu we get the proxied url, but that's normal due to how you hooked that. Not a big deal.
- fox
- ^ me reading your posts ^
- Posts: 6318
- Joined: 27 Aug 2005, 22:53
- Location: Saint-Petersburg, Russia
- Contact:
Re: About af_zz_imgproxy (Load insecure images via built-in proxy)
probably not the best idea because not all attachments are necessarily images
e: should be limited now similar to how embedding is done
e: should be limited now similar to how embedding is done
-
- Bear Rating Trainee
- Posts: 6
- Joined: 06 Jan 2016, 14:38
Re: About af_zz_imgproxy (Load insecure images via built-in proxy)
Your latest commit broke it, it no longer proxies attachments.
I edited your code like this, and it works again:
(content_type instead of type, allow jpeg extension, extension matches end of filename)
I edited your code like this, and it works again:
Code: Select all
if (preg_match("/image/", $enc["content_type"]) || preg_match("/\.(jpe?g|png|gif|bmp)$/i", $enc["filename"]))
(content_type instead of type, allow jpeg extension, extension matches end of filename)
- fox
- ^ me reading your posts ^
- Posts: 6318
- Joined: 27 Aug 2005, 22:53
- Location: Saint-Petersburg, Russia
- Contact:
Re: About af_zz_imgproxy (Load insecure images via built-in proxy)
ah right that datatype gets changed in the middle of that function
copy pasting things will be the end of me *he said while copypasting from the forums*
copy pasting things will be the end of me *he said while copypasting from the forums*
-
- Bear Rating Trainee
- Posts: 6
- Joined: 06 Jan 2016, 14:38
Re: About af_zz_imgproxy (Load insecure images via built-in proxy)
And also, extensions are at the end of filenames, so you can add $ to the regex here ![Razz :P](images/smilies/icon_razz.gif)
EDIT: Oops that's more difficult, it can contains a query string!![Sad :(](images/smilies/icon_sad.gif)
EDIT2: You've forgotten the parameter $kind in hook_enclosure_entry.
EDIT3: I ended up forking and making my own improvements, to proxy every worth external content. I merged the plugin no_iframes and removed the whitelist (I show a thumbnail image for Youtube videos or [iframe to example.com]). It no longer only proxies mixed content. Will send it later.
![Razz :P](images/smilies/icon_razz.gif)
EDIT: Oops that's more difficult, it can contains a query string!
![Sad :(](images/smilies/icon_sad.gif)
EDIT2: You've forgotten the parameter $kind in hook_enclosure_entry.
EDIT3: I ended up forking and making my own improvements, to proxy every worth external content. I merged the plugin no_iframes and removed the whitelist (I show a thumbnail image for Youtube videos or [iframe to example.com]). It no longer only proxies mixed content. Will send it later.
- fox
- ^ me reading your posts ^
- Posts: 6318
- Joined: 27 Aug 2005, 22:53
- Location: Saint-Petersburg, Russia
- Contact:
Re: About af_zz_imgproxy (Load insecure images via built-in proxy)
ah right, $kind should be fixed now.
Return to “Themes and plugins”
Who is online
Users browsing this forum: No registered users and 1 guest