diff options
Diffstat (limited to 'phpBB/includes/bbcode.php')
-rw-r--r-- | phpBB/includes/bbcode.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index b1a6a794cc..b7c1028db4 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -440,6 +440,38 @@ function make_clickable($text) return($ret); } +/** + * Nathan Codding - Feb 6, 2001 + * Reverses the effects of make_clickable(), for use in editpost. + * - Does not distinguish between "www.xxxx.yyyy" and "http://aaaa.bbbb" type URLs. + * + */ + +function undo_make_clickable($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); + + return $text; + +} + + + +/** + * Nathan Codding - August 24, 2000. + * Takes a string, and does the reverse of the PHP standard function + * htmlspecialchars(). + */ +function undo_htmlspecialchars($input) { + $input = preg_replace("/>/i", ">", $input); + $input = preg_replace("/</i", "<", $input); + $input = preg_replace("/"/i", "\"", $input); + $input = preg_replace("/&/i", "&", $input); + + return $input; +} + /** |