Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
Blocking < in Shoutbox
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2010-11-18 15:12:23
hello all i have a feature for your shoutbox whit this little modification would block

<html

<script

<?php

also nobody kann inject code in your shoutbox, i hope you know what i mean   :)

lets start.

open shoutbox.php or shoutin.php and find

//INSERT MESSAGE

if (!empty($_POST['message']) && $CURUSER) {

$_POST['message'] = sqlesc($_POST['message']);
set bevor this




$text=utf8_decode(trim($_POST['message']));

// blocking some code links

if ( ereg('\<', $text))

$text='';





for blocking code an this when you will blocking code and <a href=... links





$text=utf8_decode(trim($_POST["message"]));

// blocking www links and code

if ( ereg("\<(a|A)\ (href|HREF|Href|HrEf|hReF|hrEF|HRef|HREf|hreF)", $text))

$text='';

else

if ( ereg("\<", $text))

$text='';




thats all

PS: sorry for bad english  :huh:
Unknown User
2010-11-18 15:19:15
screen please :huh:
Unknown User
2010-11-18 15:56:34
there is only code not show anithing at your site.

the function is easy.

a user type in shout <hello an the script makes no output, thats all

it blocks the < so nobidy can make <script href=xxxx.xx/javascriptXSS.js></script> or other code
Unknown User
2010-11-18 18:15:47
ereg is deprecated use preg_match instead.
Unknown User
2010-11-18 18:22:59
preg_match issn
Unknown User
2010-11-18 18:31:06
"bolzen, post: 67659":
preg_match issn
Unknown User
2010-11-19 07:06:08
ok mi don
Unknown User
2010-11-20 09:59:53
here this should do a similar job.

$find=array("@<a[^>]*?>.*?</a>@si","@<A[^>]*?>.*?</a>@si","@<?php[^>]*?>@si","@<?[^>]*?>@si","@<script[^>]*?>@si");

$replace = array("","","","","");

$text=preg_replace($find,$replace,$text);
Unknown User
2010-11-25 17:41:09
Don't really need to do that. shoutbox uses format_comment(), so bbcode works and things like < and > are converted to the HTML entities (&lt; and &gt;)
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728