What;s wrong??
By: Xmoo | Date: May 7 2009 10:49 | Format: PHP | Expires: never | Size: 7.63 KB | Hits: 1402
- <?php
- function noXSS ($input) {
- # add slashes if PHP didn't do it.
- #replace: javascript,'
- 'javascript',
- '"'
- 'java script',
- '''
- ),$input);
- #replace: ", <, >,&
- return $input;
- }
- //bb_codes
- function ubb_code($string) {
- $string = noXSS($string);
- //smileys
- //bb_flags
- //bb_news
- //bb_codes
- $string = preg_replace("#[url](http|ftp)(.+?)[/url]#is","<a href="\1\2" target="_blank">\1\2</a>",$string);
- $string = preg_replace("#[url](mailto:)(.+?)[/url]#is","<a href="\1\2" target="_blank">\2</a>",$string);
- $string = preg_replace("#[url](.+?)[/url]#is","<a href="http://\1" target="_blank">\1</a>",$string);
- $string = preg_replace("#[url=(http|ftp|mailto)(.+?)](.+?)[/url]#is","<a href="\1\2" target="_blank">\3</a>",$string);
- $string = preg_replace("#[url=(.+?)](.+?)[/url]#is","<a href="http://\1" target="_blank">\2</a>",$string);
- $string = eregi_replace("(^|[ nrt])((http(s?)://)(www.)?([a-z0-9_-]+(.[a-z0-9_-]+)+)(/[^/ nr]*)*)","\1<a href="\2" target="_blank">\2</a>", $string);
- $string = eregi_replace("(^|[ nrt])((ftp://)(www.)?([a-z0-9_-]+(.[a-z0-9_-]+)+)(/[^/ nr]*)*)","\1<a href="\2" target="_blank">\2</a>", $string);
- $string = eregi_replace("([a-z_-][a-z0-9._-]*@[a-z0-9_-]+(.[a-z0-9_-]+)+)","<a href="mailto:\1">\1</a>", $string);
- $string = eregi_replace("(^|[ nrt])(www.([a-z0-9_-]+(.[a-z0-9_-]+)+)(/[^/ nr]*)*)","\1<a href="http://\2" target="_blank">\2</a>", $string);
- $string = eregi_replace("(^|[ nrt])(ftp.([a-z0-9_-]+(.[a-z0-9_-]+)+)(/[^/ nr]*)*)","\1<a href="ftp://\2" target="_blank">\2</a>", $string);
- $string = preg_replace("#[quote](.+?)[/quote]#is","<table width="100%" cellspacing="0" cellpadding="0"><tr><td width="3%"> </td><td><small>Quote</small></td></tr><tr><td width="3%"> </td><td style="border: 1px solid #232850;"><table><tr><td>\1</td></tr></table></td></tr></table>",$string);
- $string = preg_replace("#[quote=(.+?)](.+?)[/quote]#is","<table width="100%" cellspacing="0" cellpadding="0"><tr><td width="3%"> </td><td><small>Quote: <b>\1</b></small></td></tr><tr><td width="3%"> </td><td style="border: 1px solid #232850;"><table><tr><td>\2</td></tr></table></td></tr></table>",$string);
- for($i = 128; $i < 160; $i++) // for($i = 128; $i < 256; $i++)
- {
- }
- return $string;
- }
- ?>
Latest pastes
1 hours ago
11 hours ago
1 days ago
2 days ago
2 days ago