From f5e583cee9072294b81c5d4be2eb0356286346bb Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Wed, 18 Dec 2002 23:38:12 +0000 Subject: [PATCH] bbcode img updates/fixes git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3212 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 3 ++- phpBB/includes/bbcode.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 28a2d8fbe0..eb23edef55 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -150,7 +150,8 @@ p,ul,td {font-size:10pt;}
  • Fixed missing default constraints for post table under MSSQL
  • Fixed incorrect field size for forum pruning - preventing days > 256
  • Fixed continuing redirect issues for broken web servers, e.g. IIS+CGI PHP
  • -
  • +
  • Fixed inability to use ftp as a protocol for the [img] tag
  • +
  • Fixed incorrect handling of [img] tags containing %20 encoded spaces
  • diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 49fef9f9ad..e074faa88a 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -282,7 +282,7 @@ function bbencode_first_pass($text, $uid) $text = preg_replace("#\[i\](.*?)\[/i\]#si", "[i:$uid]\\1[/i:$uid]", $text); // [img]image_url_here[/img] code.. - $text = preg_replace("#\[img\](http://)([^ \r\n\t<\"]*?)\[/img\]#si", "[img:$uid]\\1\\2[/img:$uid]", $text); + $text = preg_replace("#\[img\]((ht|f)tp://)([^\r\n\t<\"]*?)\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text); // Remove our padding from the string.. return substr($text, 1);;