[Phpfreechat-svn] SF.net SVN: phpfreechat: [1146] trunk
Status: Beta
Brought to you by:
kerphi
From: <gpi...@us...> - 2007-09-04 13:57:17
|
Revision: 1146 http://phpfreechat.svn.sourceforge.net/phpfreechat/?rev=1146&view=rev Author: gpinzone Date: 2007-08-26 09:23:20 -0700 (Sun, 26 Aug 2007) Log Message: ----------- Added JavaScript to remove auto-linked entries from PHP, if desired. Currently never used. Restored double-space to " " JavaScript that was erroneously commented out. Modified Paths: -------------- trunk/data/public/js/pfcclient.js trunk/src/pfcurlprocessing.php Modified: trunk/data/public/js/pfcclient.js =================================================================== --- trunk/data/public/js/pfcclient.js 2007-08-24 15:13:24 UTC (rev 1145) +++ trunk/data/public/js/pfcclient.js 2007-08-26 16:23:20 UTC (rev 1146) @@ -1424,11 +1424,21 @@ replace = replace + '>$2</a>$3'; msg = msg.replace(rx_url, replace); } - +*/ + + // Remove auto-linked entries. + if ( false ) + { + rx = new RegExp('<a href="mailto:(.*?)".*?>.*?<\/a>','ig'); + msg = msg.replace(rx, '$1'); + rx = new RegExp('<a href="(.*?)".*?>.*?<\/a>','ig'); + msg = msg.replace(rx, '$1'); + } + // replace double spaces by entity rx = new RegExp(' ','g'); msg = msg.replace(rx, ' '); -*/ + // try to parse bbcode rx = new RegExp('\\[b\\](.+?)\\[\/b\\]','ig'); msg = msg.replace(rx, '<span style="font-weight: bold">$1</span>'); Modified: trunk/src/pfcurlprocessing.php =================================================================== --- trunk/src/pfcurlprocessing.php 2007-08-24 15:13:24 UTC (rev 1145) +++ trunk/src/pfcurlprocessing.php 2007-08-26 16:23:20 UTC (rev 1146) @@ -62,8 +62,8 @@ */ function pfc_undo_make_hyperlink($text) { - $text = preg_replace("#<!-- BBCode auto-link start --><a href=\"(.*?)\" target=\"_blank\">.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text); - $text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\">.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text); + $text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\".*?>.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text); + $text = preg_replace("#<!-- BBCode auto-link start --><a href=\"(.*?)\".*?>.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text); return $text; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |