[Snippet] No Hotlinking into Forum (de)

Snippet-Area for phpBB 3.0.x

[Snippet] No Hotlinking into Forum (de)

Postby 4seven » Sat 12. Sep 2009, 16:35 | Userzeit: +1.00 / Sa 12. Sep 2009, 17:35

so werden alle Bildlinks, die von "Außen" gepostet werden im Klartext ausgeworfen.
Nur die Domain-eigenen Pics werden angezeigt

Es erfolgt also keinerlei Hotlinking :wink:

Öffne

includes/bbcode.php

Finde

Code: Select all
         case 4:
               if ($user->optionget('viewimg'))
               {
                  $this->bbcode_cache[$bbcode_id] = array(
                     'preg' => array(
                        '#\[img:$uid\](.*?)\[/img:$uid\]#s'      => $this->bbcode_tpl('img', $bbcode_id),
                     )
                  );
               }
               else
               {
                  $this->bbcode_cache[$bbcode_id] = array(
                     'preg' => array(
                        '#\[img:$uid\](.*?)\[/img:$uid\]#s'      => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)),
                     )
                  );
               }

            break;


Ersetze mit


Code: Select all
         case 4:
               if ($user->optionget('viewimg'))
               {
                  $this->bbcode_cache[$bbcode_id] = array(
                     'preg' => array(
'#\[img:$uid\](http://www.deinforum.de/?.*?)\[/img:$uid\]#s'      => $this->bbcode_tpl('img', $bbcode_id),
'#\[img:$uid\](http://deinforum.de/?.*?)\[/img:$uid\]#s'      => $this->bbcode_tpl('img', $bbcode_id),
                     )
                  );
               }
               else
               {
                  $this->bbcode_cache[$bbcode_id] = array(
                     'preg' => array(
'#\[img:$uid\](http://www.deinforum.de/?.*?)\[/img:$uid\]#s'      => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)),
'#\[img:$uid\](http://deinforum.de/?.*?)\[/img:$uid\]#s'      => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)),
                     )
                  );
               }

            break;


http://www.deinforum.de/ ist zu ersetzen
User avatar
4seven
Administrator
 
Posts: 427
 
Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...
 
Joined:
Sun 13. Jan 2008, 23:44
 
Letzter Login:
Mon 1. Aug 2022, 16:40
 
Posted:
Sat 12. Sep 2009, 16:35 +1.00
Userzeit: Sa 12. Sep 2009, 17:35

Re: [Snippet] No Hotlinking into Forum

Postby 4seven » Sat 12. Sep 2009, 16:35 | Userzeit: +1.00 / Sa 12. Sep 2009, 17:35

um die Liste der erlaubten ins-Forum-Hotlinker zu erweitern:

Öffne

includes/bbcode.php

und dupliziere den relevanten Eintrag (s.o.) nach belieben

Code: Select all
         case 4:
               if ($user->optionget('viewimg'))
               {
                  $this->bbcode_cache[$bbcode_id] = array(
                     'preg' => array(
'#\[img:$uid\](http://www.deinforum.de/?.*?)\[/img:$uid\]#s'      => $this->bbcode_tpl('img', $bbcode_id),
'#\[img:$uid\](http://deinforum.de/?.*?)\[/img:$uid\]#s'      => $this->bbcode_tpl('img', $bbcode_id),
'#\[img:$uid\](http://static.flickr.com/?.*?)\[/img:$uid\]#s'      => $this->bbcode_tpl('img', $bbcode_id),   
'#\[img:$uid\](http://img1.imageshack.us/?.*?)\[/img:$uid\]#s'      => $this->bbcode_tpl('img', $bbcode_id),   
                     )
                  );
               }
               else
               {
                  $this->bbcode_cache[$bbcode_id] = array(
                     'preg' => array(
'#\[img:$uid\](http://www.deinforum.de/?.*?)\[/img:$uid\]#s'      => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)),
'#\[img:$uid\](http://deinforum.de/?.*?)\[/img:$uid\]#s'      => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)),
'#\[img:$uid\](http://static.flickr.com/?.*?)\[/img:$uid\]#s'      => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)),
'#\[img:$uid\](http://img1.imageshack.us/?.*?)\[/img:$uid\]#s'      => str_replace('$2', '[ img ]', $this->bbcode_tpl('url', $bbcode_id, true)),   
                     )
                  );
               }

            break;
User avatar
4seven
Administrator
 
Posts: 427
 
Last 3 Topics:
Tabmenu Test
[Snippet] Avatar Ev...
[DEV] Zero and X-P...
 
Joined:
Sun 13. Jan 2008, 23:44
 
Letzter Login:
Mon 1. Aug 2022, 16:40
 
Posted:
Sat 12. Sep 2009, 16:35 +1.00
Userzeit: Sa 12. Sep 2009, 17:35


Return to [Snippet] for 3.0.x



Who is online

Users browsing this forum: No registered users and 0 guests