aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2003-01-07 14:37:19 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2003-01-07 14:37:19 +0000
commit7bdb2816f9855a1675c25b152e3c0cadd9ee57ae (patch)
treea281bb78eb14a6efd36df7d077b23aff27bec6c1 /phpBB/includes/functions_posting.php
parentb369a1e43cdeb9edeee8b4c86fbc395c7bb5d202 (diff)
downloadforums-7bdb2816f9855a1675c25b152e3c0cadd9ee57ae.tar
forums-7bdb2816f9855a1675c25b152e3c0cadd9ee57ae.tar.gz
forums-7bdb2816f9855a1675c25b152e3c0cadd9ee57ae.tar.bz2
forums-7bdb2816f9855a1675c25b152e3c0cadd9ee57ae.tar.xz
forums-7bdb2816f9855a1675c25b152e3c0cadd9ee57ae.zip
Various updates
git-svn-id: file:///svn/phpbb/trunk@3262 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index a198b1dcf8..325c796b77 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -41,7 +41,7 @@ class parse_message
$match[] = "#([\r\n][\s]+){3,}#";
$replace[] = "\n\n";
- $message = preg_replace($match, $replace, $message);
+ $message = trim(preg_replace($match, $replace, $message));
// Message length check
if (!strlen($message) || ($config['max_post_chars'] && strlen($message) > intval($config['max_post_chars'])))
@@ -135,12 +135,12 @@ class parse_message
$replace[] = '<!-- l --><a href="\1" target="_blank">\1</a><!-- l -->';
// matches a xxxx://aaaaa.bbb.cccc. ...
- $match[] = '#(^|[\n ])([\w]+?://[\w\?&\#,\.\+\-!~\/=%]+)#ie';
- $replace[] = "'\\1<!-- m --><a href=\"\\2\" target=\"_blank\">' . ( ( strlen('\\2') > 55 ) ?substr('\\2', 0, 39) . ' ... ' . substr('\\2', -10) : '\\2' ) . '</a><!-- m -->'";
+ $match[] = '#(^|[\n ])([\w]+?://.*?[^\t\n\r<"]*)#ie';
+ $replace[] = "'\\1<!-- m --><a href=\"\\2\" target=\"_blank\">' . ( ( strlen(str_replace(' ', '%20', '\\2')) > 55 ) ?substr(str_replace(' ', '%20', '\\2'), 0, 39) . ' ... ' . substr(str_replace(' ', '%20', '\\2'), -10) : str_replace(' ', '%20', '\\2') ) . '</a><!-- m -->'";
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
- $match[] = '#(^|[\n ])(www\.[\w\-]+\.[\w\-.\~]+(?:/[^\t\n\r <"\']*)?)#ie';
- $replace[] = "'\\1<!-- w --><a href=\"http://\\2\" target=\"_blank\">' . ( ( strlen('\\2') > 55 ) ?substr('\\2', 0, 39) . ' ... ' . substr('\\2', -10) : '\\2' ) . '</a><!-- w -->'";
+ $match[] = '#(^|[\n ])(www\.[\w\-]+\.[\w\-.\~]+(?:/[^\t\n\r<"]*)?)#ie';
+ $replace[] = "'\\1<!-- w --><a href=\"http://\\2\" target=\"_blank\">' . ( ( strlen(str_replace(' ', '%20', '\\2')) > 55 ) ? substr(str_replace(' ', '%20', '\\2'), 0, 39) . ' ... ' . substr(str_replace(' ', '%20', '\\2'), -10) : str_replace(' ', '%20', '\\2') ) . '</a><!-- w -->'";
// matches an email@domain type address at the start of a line, or after a space.
$match[] = '#(^|[\n ])([a-z0-9\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)#ie';
@@ -179,8 +179,9 @@ class parse_message
global $config;
$allowed_ext = explode(',', $config['attach_ext']);
- }
+
+ }
}
// Parses a given message and updates/maintains the fulltext tables