vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Mini Mods - IMG Cacher - SSL Keeper - Mixed Content Block Solution (https://vborg.vbsupport.ru/showthread.php?t=288060)

MegaManSec 09-19-2012 10:00 PM

IMG Cacher - SSL Keeper - Mixed Content Block Solution
 
1 Attachment(s)
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)

sivaganeshk 09-23-2012 05:44 AM

Quote:

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(which is untrue) - this is a solution to that problem.
Thanks.
Is there a similar solution to loads adsense in SSL forum without any warning?

MegaManSec 09-23-2012 07:18 AM

Quote:

Originally Posted by sivaganeshk (Post 2367819)
Thanks.
Is there a similar solution to loads adsense in SSL forum without any warning?

I'll give you an example of how to do it.

This is mine:
Code:

<script type="text/javascript"><!--
google_ad_client = "ca-pub-8761986403507850";
/* bugabuse */
google_ad_slot = "9327213821";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

edit this part:
Code:

src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
and make it https:// :p

DoDe 09-23-2012 07:36 AM

The embedded image appears in the cache_img directory but it doesn't appear in the posted thread. How to make it appear there?

MegaManSec 09-23-2012 07:41 AM

Quote:

Originally Posted by DoDe (Post 2367831)
The embedded image appears in the cache_img directory but it doesn't appear in the posted thread. How to make it appear there?

Code:

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:

this part. if you've already done that and it doesn't work, PM me some credentials for me to login to your forum (and a link to the forum) and I'll have a look.

sivaganeshk 09-23-2012 07:44 AM

Quote:

Originally Posted by loaep (Post 2367828)
I'll give you an example of how to do it.

This is mine:
Code:

<script type="text/javascript"><!--
google_ad_client = "ca-pub-8761986403507850";
/* bugabuse */
google_ad_slot = "9327213821";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

edit this part:
Code:

src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
and make it https:// :p

LoL. but editing the adsense code may lead to account ban. I searched about it few months ago.. :erm:

MegaManSec 09-23-2012 07:47 AM

Quote:

Originally Posted by sivaganeshk (Post 2367833)
LoL. but editing the adsense code may lead to account ban. I searched about it few months ago.. :erm:

replacing http with https will not cause a ban.

MegaManSec 09-23-2012 08:14 AM

Please re-download the modification. I forgot to update a part of the code for it to actually work.

Once you've re-downloaded it, it will work.

DoDe 09-23-2012 08:20 AM

Ok, thanks!

Edited: It's working now,

thanks again :up: !

Dorgham 11-02-2012 01:33 AM

Great work
product has been added successfully
Thank you


All times are GMT. The time now is 03:29 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01365 seconds
  • Memory Usage 1,748KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (8)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete