|
From: <dj...@us...> - 2013-04-19 21:06:20
|
Revision: 11407
http://sourceforge.net/p/xoops/svn/11407
Author: djculex
Date: 2013-04-19 21:06:16 +0000 (Fri, 19 Apr 2013)
Log Message:
-----------
Bugfix : Parsing links double
Bugfix : Removing nl2br (module.sanitizer already does this)
Modified Paths:
--------------
XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
XoopsModules/smallworld/trunk/smallworld/include/functions.php
XoopsModules/smallworld/trunk/smallworld/loadmore.php
XoopsModules/smallworld/trunk/smallworld/message_ajax.php
XoopsModules/smallworld/trunk/smallworld/permalink.php
XoopsModules/smallworld/trunk/smallworld/publicindex.php
XoopsModules/smallworld/trunk/smallworld/userprofile.php
Modified: XoopsModules/smallworld/trunk/smallworld/comment_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/comment_ajax.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -71,7 +71,7 @@
$wc['msg_id_fk'] = $data['msg_id_fk'];
$wc['com_id'] = $data['com_id'];
- $wc['comment'] = ($USC['comments'] == 1) ? nl2br(smallworld_tolink(htmlspecialchars_decode($data['comment']),$data['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
+ $wc['comment'] = ($USC['comments'] == 1) ? smallworld_tolink(htmlspecialchars_decode($data['comment']),$data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
$wc['comment'] = Smallworld_cleanup($wc['comment']);
$wc['time'] = smallworld_time_stamp($data['created']);
$wc['username'] = $data['username'];
Modified: XoopsModules/smallworld/trunk/smallworld/include/functions.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/include/functions.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -54,13 +54,8 @@
// Sanitize string
function Smallworld_cleanup_string($text)
{
- // $text = htmlspecialchars($text, ENT_QUOTES);
- $myts = MyTextSanitizer::getInstance();
- $text = $myts->displayTarea($text, 1, 1, 1, 1);
- $text = str_replace("\n\r", "\n", $text);
- $text = str_replace("\r\n", "\n", $text);
- $text = str_replace("\n", "<br />", $text);
- $text = str_replace("\"", "'", $text);
+ $myts = MyTextSanitizer::getInstance();
+ $text = $myts->displayTarea($text, $html = 1, $smiley = 1, $xcode = 1, $image = 1, $br = 1);
return $text;
}
@@ -270,14 +265,6 @@
} else {
$text = html_entity_decode($text,ENT_QUOTES,"UTF-8");
$text = " " . $text;
- $text = preg_replace('/(((f|ht){1}tp:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i',
- '<a href="\\1">\\1</a>', $text);
- $text = preg_replace('/(((f|ht){1}tps:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i',
- '<a href="\\1">\\1</a>', $text);
- $text = preg_replace('/([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i',
- '\\1<a href="\\2">\\2</a>', $text);
- $text = preg_replace('/([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})/i',
- '<a href="mailto:\\1">\\1</a>', $text);
$text = str_replace('UPLIMAGE', '', $text);
}
return $text;
Modified: XoopsModules/smallworld/trunk/smallworld/loadmore.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/loadmore.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/loadmore.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -108,7 +108,7 @@
$wm['msg_id'] = $data['msg_id'];
$wm['orimessage'] = ($USW['posts'] == 1) ? str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
- $wm['message'] = ($USW['posts'] == 1) ? nl2br(smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
+ $wm['message'] = ($USW['posts'] == 1) ? smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
$wm['message'] = Smallworld_cleanup($wm['message']);
$wm['created'] = smallworld_time_stamp($data['created']);
$wm['username'] = $data['username'];
@@ -157,7 +157,7 @@
$wc['msg_id_fk'] = $cdata['msg_id_fk'];
$wc['com_id'] = $cdata['com_id'];
- $wc['comment'] = ($USC['comments'] == 1) ? nl2br(smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
+ $wc['comment'] = ($USC['comments'] == 1) ? smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
$wc['comment'] = Smallworld_cleanup($wc['comment']);
$wc['time'] = smallworld_time_stamp($cdata['created']);
$wc['username'] = $cdata['username'];
Modified: XoopsModules/smallworld/trunk/smallworld/message_ajax.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/message_ajax.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -78,7 +78,7 @@
$wm['msg_id'] = $data['msg_id'];
$wm['orimessage'] = ($USW['posts'] == 1) ? str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
- $wm['message'] = ($USW['posts'] == 1) ? nl2br(smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
+ $wm['message'] = ($USW['posts'] == 1) ? smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
$wm['message'] = Smallworld_cleanup($wm['message']);
$wm['created'] = smallworld_time_stamp($data['created']);
$wm['username'] = $data['username'];
@@ -127,7 +127,7 @@
$wc['msg_id_fk'] = $cdata['msg_id_fk'];
$wc['com_id'] = $cdata['com_id'];
- $wc['comment'] = ($USC['comments'] == 1) ? nl2br(smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
+ $wc['comment'] = ($USC['comments'] == 1) ? smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
$wc['comment'] = Smallworld_cleanup($wc['comment']);
$wc['time'] = smallworld_time_stamp($cdata['created']);
$wc['username'] = $cdata['username'];
Modified: XoopsModules/smallworld/trunk/smallworld/permalink.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/permalink.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/permalink.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -101,7 +101,7 @@
$wm['msg_id'] = $data['msg_id'];
$wm['orimessage'] = ($USW['posts'] == 1) ? str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
- $wm['message'] = ($USW['posts'] == 1) ? nl2br(smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
+ $wm['message'] = ($USW['posts'] == 1) ? smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
$wm['message'] = Smallworld_cleanup($wm['message']);
$wm['created'] = smallworld_time_stamp($data['created']);
$wm['username'] = $data['username'];
@@ -143,7 +143,7 @@
$wc['msg_id_fk'] = $cdata['msg_id_fk'];
$wc['com_id'] = $cdata['com_id'];
- $wc['comment'] = ($USC['comments'] == 1) ? nl2br(smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
+ $wc['comment'] = ($USC['comments'] == 1) ? smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
$wc['comment'] = Smallworld_cleanup($wc['comment']);
$wc['time'] = smallworld_time_stamp($cdata['created']);
$wc['username'] = $cdata['username'];
Modified: XoopsModules/smallworld/trunk/smallworld/publicindex.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/publicindex.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/publicindex.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -102,7 +102,7 @@
$wm['msg_id'] = $data['msg_id'];
$wm['orimessage'] = ($USW['posts'] == 1) ? str_replace(array("\r", "\n"), '',Smallworld_stripWordsKeepUrl($data['message'])):'';
- $wm['message'] = ($USW['posts'] == 1) ? nl2br(smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
+ $wm['message'] = ($USW['posts'] == 1) ? smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETPOSTS;
$wm['message'] = Smallworld_cleanup($wm['message']);
$wm['created'] = smallworld_time_stamp($data['created']);
$wm['username'] = $data['username'];
@@ -149,7 +149,7 @@
$wc['msg_id_fk'] = $cdata['msg_id_fk'];
$wc['com_id'] = $cdata['com_id'];
- $wc['comment'] = ($USC['comments'] == 1) ? nl2br(smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk'])):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
+ $wc['comment'] = ($USC['comments'] == 1) ? smallworld_tolink(htmlspecialchars_decode($cdata['comment']),$cdata['uid_fk']):_SMALLWORLD_MESSAGE_PRIVSETCOMMENTS;
$wc['comment'] = Smallworld_cleanup($wc['comment']);
$wc['time'] = smallworld_time_stamp($cdata['created']);
$wc['username'] = $cdata['username'];
Modified: XoopsModules/smallworld/trunk/smallworld/userprofile.php
===================================================================
--- XoopsModules/smallworld/trunk/smallworld/userprofile.php 2013-04-19 01:01:56 UTC (rev 11406)
+++ XoopsModules/smallworld/trunk/smallworld/userprofile.php 2013-04-19 21:06:16 UTC (rev 11407)
@@ -113,7 +113,7 @@
foreach ($updatesarray as $data) {
$wm['msg_id'] = $data['msg_id'];
$wm['orimessage'] = str_replace(array("\r", "\n"), '',$data['message']);
- $wm['message'] = nl2br(smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']));
+ $wm['message'] = smallworld_tolink(htmlspecialchars_decode($data['message']), $data['uid_fk']);
$wm['message'] = Smallworld_cleanup($wm['message']);
$wm['created'] = smallworld_time_stamp($data['created']);
$wm['username'] = $data['username'];
@@ -142,7 +142,7 @@
foreach($wm['commentsarray'] as $cdata) {
$wc['msg_id_fk'] = $cdata['msg_id_fk'];
$wc['com_id'] = $cdata['com_id'];
- $wc['comment'] = nl2br(smallworld_tolink(htmlspecialchars_decode($cdata['comment']), $cdata['uid_fk']));
+ $wc['comment'] = smallworld_tolink(htmlspecialchars_decode($cdata['comment']), $cdata['uid_fk']);
$wc['comment'] = Smallworld_cleanup($wc['comment']);
$wc['time'] = smallworld_time_stamp($cdata['created']);
$wc['username'] = $cdata['username'];
|