February 09 2010 11:33:28
Navigation
Users Online
· Guests Online: 21

· Members Online: 1
Softovick

· Total Members: 28,326
· Newest Member: EricCharles
IRC Channel
Got an IRC Client?
Join our new IRC channel at

irc.freenode.com/phpfusion

Free IRC Clients: Wikipedia
Support Sites
Last Seen Users
· SoftovickOnline
· Barspin00:16:43
· EricCharles00:17:01
· afif00:26:48
· rupesh198600:30:34
· SiteMaster00:32:45
· jonyzs00:49:48
· starefossen01:05:10
· ctokepa01:13:40
· kloot01:22:17
Donate
Improved IMG BBCode fix
SecurityEdit maincore.php and make the following changes:

1. After this function:
// Validate numeric input
function isnum($value) {
return (preg_match("/^[0-9]+$/", $value));
}



Insert the following:
// Validate bbcode images
function isImage($matches) {
$im = $matches[1].str_replace(array("?","&","="),"",$matches[3]).$matches[4];
if (list($width, $height, $type, $attr) = @getimagesize($im)) {
$ret = "<img src='".$im."' style='border:0px;'>";
} else {
$ret = "[img]Image Blocked[/img]";
}
return $ret;
}




2. Remove these lines under the parseubb function:
$ubbs1[10] = '#\[img\](.*?)\[/img\]#si';
$ubbs2[10] = '<img src=\'\1\' border=\'0\'>';



or if you've applied the first bb fix remove these lines:
$ubbs1[10] = "#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#sie";
$ubbs2[10] = "'<img src=\'\\1'.str_replace(array('?','&','='),'','\\3').'\\4\'>'";




3. After this line:
for ($i=0;$i < $ubbitems;$i++) $message = preg_replace($ubbs1, $ubbs2, $message);



Insert:
$message = preg_replace_callback("#\[img\]((http|ftp|https|ftps)://)(.*?)(\.(jpg|jpeg|gif|png|JPG|JPEG|GIF|PNG))\[/img\]#si","isImage",$message);


Ratings
Rating is available to Members only.

Please login or register to vote.

No Ratings have been Posted.
Login
Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.
RSS Feeds
- PHP-Fusion News
- SF File Releases
- SF News Releases
Latest Roadmap Items
Shoutbox
You must login to post a message.

09 Feb 2010 11:06:11
welcome pitbull!

09 Feb 2010 07:02:29
Hello everybody, I'm a new member, have a good day everybody...

08 Feb 2010 17:11:07
Hello Darchangel and erm Darchangel... Grin

08 Feb 2010 16:11:03
Hello guys and erm guys... Grin

08 Feb 2010 15:47:37
@Sampler- English only Please!

08 Feb 2010 03:32:56
Tell me few, I like to listen bands from various countries. (Is "some", "few" or "a few"?) Pfft

07 Feb 2010 22:28:01
Rammstein is nice, but I prefer some scandinavian bands Smile

07 Feb 2010 21:47:46
@blabla - post the link to your site in the Show Off forum not the Shoutbox. Thanks.

07 Feb 2010 19:59:00
@Shift95: questions in the forums please!

07 Feb 2010 19:44:06
In my opinion, Rammstein is only good band. @Fangree_Craig - "IMHO" was older then SMS - it's from IRC.

Render time: 0.04 seconds 58,340,903 unique visits