Tag: image

Drupal HTTPS images

Posted by on March 2, 2011 | No comments

I was involved with a project for a while which was using Drupal as the CMS. The entire site was being served over HTTPS, which was quite annoying as a large pile of the images that were being posted were being served over HTTP from their respective webservers. Naturally, this resulted in everyone getting very annoyed at their browser warning about loading unsecured content on a secure page.

So, I came up with this module. I’ve been meaning to release it for ages, but as I need to clear down the server it was running on it’s made me take the five minutes to write this post. Still needs a bit of work, but does what it says on the tin.

It identifies non-local images in content, downloads them and serves them from a local cache.

Download the module here: img_proxy.tar.gz

If you use Drupal, you should already know the drill – extract the file to your modules directory and enable it in the modules page. The module is implemented as an input filter, so you will then have to add it to the appropriate input formats at http://your.site.com/admin/settings/filters

Notes

  • Licenced under the GPL version 2.
  • *** There is nothing in the code that verifies the file being proxied is an image!! *** (that’ll be in the next version!)
  • May not work with sites that check the referer of the request for images.
  • I’ve been meaning to release this for ages, but there is sill a lot of debug code thats just commented out.

Hopefully I’m not the only webmaster that ever had this issue and somebody will find this handy.

Maybe one day I’ll tidy up the code and submit it to the Drupal Module repository!

Enjoy.

Tags: , , , , ,

Powered by Wordpress and Stripes Theme Entries (RSS) | Comments (RSS)