Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons

Reply
 
Thread Tools
IMG Cacher - SSL Keeper - Mixed Content Block Solution Details »»
IMG Cacher - SSL Keeper - Mixed Content Block Solution
Version: 2.2, by MegaManSec MegaManSec is offline
Developer Last Online: Dec 2016 Show Printable Version Email this Page

Category: Mini Mods - Version: 4.1.x Rating:
Released: 09-19-2012 Last Update: 10-29-2013 Installs: 96
Uses Plugins Template Edits
Re-useable Code Additional Files Translations  
No support by the author.

Pretty much you use this when you want to keep the SSL certificete working on pages that people may use [IMG] tag's without https://.

When you use SSL on your forum, and somebody embeds an image from a non-ssl host, lots of browsers will give you a warning and say the website is unsafe ---this is a solution to that problem.

Specifically, Mozilla has a 'Mixed Content Blocker', which makes it so if you are on an https:// website, it won't load any content on the same domain, using http://.



NOTE: MAKE SURE THE .HTACCESS FILE IN cache-img/ IS WORKING!



Upload the files into your root directory, and that's it.

Then you need to create a plugin (admincp -> plugins & products -> add new plugin)
Hook location: bbcode_img_match
Title: SSL IMG Cacher
Execution order: 5
Plugin PHP Code:
Code:
$link_parsed = parse_url($link);
if ($link_parsed['host'] != '[LINK_TO_YOUR_WEBSITE]')
{
 $link = $this->registry->options['bburl'] . '/cache.php?img=' . urlencode($link);
 $retval = ($fullsize ? '<div class="size_fullsize">' : '')  . '<img src="' .  $link . '" border="0" alt="" />' . ($fullsize ? '</div>' : '');
}
Plugin is active: Yes


edit "[LINK_TO_YOUR_WEBSITE]" - Without http, example: www.dragonbyte-tech.com or www.internot.info etc. etc.

Then you are done.

It should be secure as the actual directory for the images is not available.(deny from all in htaccess)


I would also suggest adding this to robots.txt
Code:
User-agent: *
Disallow: /cache.php
Also I suggest you add something like this to .htaccess:
Code:
<FilesMatch "cache\.php$">
Header set Cache-Control "max-age=86400, public"
</FilesMatch>
======
I only give support to people who have pressed 'installed' this.
======


Source&stuff can be found here: https://github.com/MegaManSec/IMG

For vB3.8 solution, go here: https://vborg.vbsupport.ru/showthrea...75#post2411575 (Thanks to Kh99)

Download Now

File Type: zip IMG.zip (8.6 KB, 536 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
4 благодарности(ей) от:
Andreasmax, Duke49th, seb5594, VBFguy

Comments
  #52  
Old 04-11-2017, 08:24 PM
djbaxter djbaxter is offline
 
Join Date: Aug 2006
Location: Ottawa, Canada
Posts: 2,601
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you. I was having difficulty with the "mixed content" warning for one of my forums which exists as a subdomain.

I tried a competitive add-on which sadly did not work for me.

Your instructions for installing this add-on are a little ambiguous
  • files and folders to upload (cache-img and images folders, cache.html, cache.php) might be better packaged under the standard Upload folder
  • you need to add the instruction to change the properties of the cache-img folder to 777 after uploading
  • the instructions on replacing [LINK_TO_YOUR_WEBSITE] with the domain of the forum might explicitly state "including the square brackets"

but I am very happy to report that this completely resolved the mixed content issue for me. :up:
Reply With Quote
  #53  
Old 09-07-2017, 03:38 PM
weinstoc weinstoc is offline
 
Join Date: Apr 2007
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

I installed this and it looked like it was working fine...but I forgot that our forums are served out of three load balanced servers...so each had its own cache. I moved the location of cache-img to a shared device to solve this. What can I do to make the previously cached images show up properly? (There already so many cached files on each server that the mv * command gets an error.)
Reply With Quote
  #54  
Old 09-07-2017, 03:57 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What do you mean by "What can I do to make the previously cached images show up properly?"?
Did you move all the images to the cache folder on the new server but it's not working? Are you sure the chown (group) and chmod permissions are properly setup?
Reply With Quote
  #55  
Old 09-07-2017, 04:03 PM
weinstoc weinstoc is offline
 
Join Date: Apr 2007
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am in the process of moving them now. When I could not get a simple mv * /shared_folder to work I was hoping things would be re-cached. But I am using tar to do the transfer now. Hopefully that will work.
Reply With Quote
  #56  
Old 09-07-2017, 04:21 PM
weinstoc weinstoc is offline
 
Join Date: Apr 2007
Posts: 46
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, everything has been moved...but this isn't showing up. It seems to be an aberration though as others are showing up fine.

https://forumserver.twoplustwo.com/s...&postcount=392
Reply With Quote
  #57  
Old 09-07-2017, 04:42 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does the file https%3A%2F%2Fimgur.com%2FMkp4JII.gif exist in the cache folder?
If it does exist, it might be a permission problem of the file or cache folder.
Reply With Quote
  #58  
Old 09-13-2017, 12:36 AM
Guinevere Guinevere is offline
 
Join Date: Aug 2015
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great mod and fixes the mixed content issue, thanks - unfortunately we run a pretty large forum and the saved images are adding about 300mb a day to our server... anyone know of an option that doesn't require the use of so much server space? That's going to be an extra GB every four days, so it's fine for a temporary solution but not in the long term.

edit: If anyone else has this issue, and wants an alternate solution I ended up adding a replacement variable in each skin which found instances of http: and changed them to https: , after giving the members warning that they would only be able to use image hosts that supported https from now on.
Reply With Quote
Благодарность от:
djbaxter
  #59  
Old 09-17-2017, 10:45 AM
woodmj woodmj is offline
 
Join Date: Sep 2013
Posts: 66
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Brilliant mod! Goodbye mixed content issues.
Reply With Quote
  #60  
Old 10-16-2017, 08:57 PM
Rob Graves Rob Graves is offline
 
Join Date: May 2011
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks man! You ever come to Negril, look me up! The first rounds are on me!
Reply With Quote
  #61  
Old 10-23-2017, 04:37 PM
BGObsession's Avatar
BGObsession BGObsession is offline
 
Join Date: Apr 2009
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've installed this but it has not resolved my mixed content flags at https://www.bgobsession.com

Yes - I've done the following:
1) All files uploaded to root directory
2) CHmodded the cache-img folder to 777
3) Created plug-in and added my website address to the [] field
4) Edited my robots.txt file and the .htaccess file as described

I've done a cache clear on vbulletin admincp, cleared my Sucuri firewall cache, and browser cache but still getting mixed content flagged.

Any ideas or suggestions would be greatly appreciated.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:16 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05890 seconds
  • Memory Usage 2,322KB
  • Queries Executed 28 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (5)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete