July 31 2010 17:09:24
Navigation
Users Online
· Guests Online: 17

· Members Online: 0

· Total Members: 35,722
· Newest Member: siliesse
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
· Falcon00:08:29
· johnmonroe00:19:02
· kamfengeren00:22:50
· siliesse00:23:55
· bartek12400:36:31
· Fangree_Craig00:45:02
· Joci196800:48:08
· gittedl00:50:21
· Barspin01:02:55
· MerlinSt01:14:33
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.
Member Poll
Which PHP version are you using?











You must login to vote.
RSS Feeds
- PHP-Fusion News
- SF File Releases
- SF News Releases
Shoutbox
You must login to post a message.

31 Jul 2010 15:47:15
Hey Polarfox, look here. http://www.fangre.
../index.php

31 Jul 2010 15:34:55
Where I can find the list of differences of 7.00 and 7.01?

31 Jul 2010 15:18:16
What's the news? Is 7.01 getting released tomorrow?

31 Jul 2010 11:53:26
heelo everyone

31 Jul 2010 05:04:21
I agree

30 Jul 2010 19:08:21
It's better to just stay .co.uk all the time now, it looks great. Wink

30 Jul 2010 19:04:27
Because we do not know when we can fix the problems with phpfusion-mods.com
.

30 Jul 2010 18:48:40
Hello! Pfft

30 Jul 2010 16:14:37
Really why's that? It's better to be on the .co.uk domain anyway. Shock

30 Jul 2010 16:09:48
No, the news has been edited, mods is up and running as a subdomain of php-fusion.co.uk

Render time: 0.05 seconds 70,452,096 unique visits