implemented buildURL() function (and fixed redirecting on https page)
added comments block (file description) in each PHP file
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* @package uForum2
|
||||
* @file inc/bbcode.php
|
||||
* @copyright 2007-2015 (c) PioDer <piotrek@pioder.pl>
|
||||
* @link http://www.pioder.pl/
|
||||
* @license see LICENSE.txt
|
||||
**/
|
||||
|
||||
function BBCode($content)
|
||||
{
|
||||
@@ -35,8 +42,7 @@ function BBCode($content)
|
||||
'/\[code\](.*?)\[\/code\]/is', # [code]
|
||||
'/\\n/', # \n
|
||||
'/\\r/', # \r
|
||||
'/(^|[^"])((http:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i',
|
||||
|
||||
'/(^|[^"])((http:\/\/)[-a-zA-Z0-9@:%_\+.~#?&\/\/=]+)/i',
|
||||
);
|
||||
|
||||
$replace = array(
|
||||
@@ -77,35 +83,4 @@ function BBCode($content)
|
||||
|
||||
return preg_replace($pattern, $replace, $content);
|
||||
}
|
||||
|
||||
function StripBBCode($content)
|
||||
{
|
||||
$pattern = array(
|
||||
'/\\n/', # \n
|
||||
'/\\r/', # \r
|
||||
'/\[b\](.*?)\[\/b\]/is', # [b]
|
||||
'/\[i\](.*?)\[\/i\]/is', # [i]
|
||||
'/\[u\](.*?)\[\/u\]/is', # [u]
|
||||
'/\[s\](.*?)\[\/s\]/is', # [s]
|
||||
'/\[url=(.*?)\](.*?)\[\/url\]/is', # [url=]
|
||||
'/\[url](.*?)\[\/url\]/is', # [url]
|
||||
'/\[img](.*?)\[\/img\]/is', # [img]
|
||||
'/\[color=(.*?)\](.*?)\[\/color\]/is', # [color]
|
||||
);
|
||||
|
||||
$replace = array(
|
||||
'', # \n
|
||||
'', # \r
|
||||
'\1', # [b]
|
||||
'\1', # [i]
|
||||
'\1', # [u]
|
||||
'\1', # [s]
|
||||
'\2', # [url=]
|
||||
'\1', # [url]
|
||||
'', # [img]
|
||||
'\2', # [color]
|
||||
);
|
||||
|
||||
return preg_replace($pattern, $replace, $content);
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user