News:

Wondering if this will always be free?  See why free is better.

Main Menu

Prevent Hotlinking to Attached Files.

Started by Kays, September 18, 2009, 08:16:16 AM

Previous topic - Next topic

Kays

Yes, it could be Pretty URLs doing that since the deny image is in the themes folder.

Strange behavior.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Boby_

Very useful mod!

Unfortunately I have a problem with it - Display.php generates and error:

8: Unidentified index: session_var

It happens around this area of the code:
if(isset($_REQUEST['image']) && (!isset($_REQUEST[$context['session_var']]) || $_REQUEST[$context['session_var']] != $context['session_id']))
redirectexit($settings['default_images_url'] . '/denied.png');

if(!isset($_REQUEST['id']) && isset($_REQUEST['type']) && $_REQUEST['type'] == 'avatar' && (!isset($_REQUEST[$context['session_var']]) || $_REQUEST[$context['session_var']] != $context['session_id']))
redirectexit($settings['default_images_url'] . '/denied.png');


My version of SMF is 2.0 RC2. The version of the mod is 1.1.

YogiBear

After installing the mod, I found a number of line 1233 errors in the log after someone had been trying to download/hotlink avatars. Is that supposed to happen, Kays?
SMF v2.1.3  Mods : Snow & Garland v1.4,  PHP  v.7.4.33

Kays

@ Boby_.
Which line is it happening on?

@YogiBear.
What is the exact error?

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

YogiBear

hxxp://mysite/forums/index.php?action=dlattach;attach=5;type=avatar;e12ef42903a=10753c61f410534dd250e6890c52abef8: Undefined index: session_varFile: /home/myforum/public_html/forums/Sources/Display.php[nofollow]
Line: 1233


Here it is, Kays.  :) I have disallowed hotlinking via the cpanel if that's relevant.
SMF v2.1.3  Mods : Snow & Garland v1.4,  PHP  v.7.4.33

Kays

Thanks. :)

It looks like the same error which Boby_ is getting. I'll take a look into it.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

Kays

I'm trying to update this mod to RC3, but have encountered a bug where images and attached avatars don't show for guests. And I just can't figure it out for now.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

JulesW

Great mod, I'd love to install it on our forum, however there is a small issue:

Is there a way to get it compatible with the Thumbnail Topic Mod? This displays a thumbnail of attached pictures on the topic list page, however with this mod installed the hot-linking denied picture is shown :(

Prolly the same issue as this post by Tiribulus?
And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17

Kays

That should just require a small change to that mod. I'll take a look into it.

I still haven't figured out the problem with image attachments not showing. I guess that this is next on my list.

If at first you don't succeed, use a bigger hammer. If that fails, read the manual.
My Mods

KensonPlays

I will install this once my facebook connect error is fixed!

Owner of Mesozoic Haven

Advertisement: