1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 22:57:14 +02:00

Code optimization for speed and reduced memory usage.

This commit is contained in:
Cameron
2020-12-20 11:50:10 -08:00
parent 6b5cc07929
commit 601df26d51
91 changed files with 522 additions and 482 deletions

View File

@@ -139,7 +139,7 @@ class e_bbcode
// $matches[4] - '=' or ':' according to the separator used
// $matches[5] - any parameter
$content = preg_split('#(\[(?:\w|/\w).*?\])#mis', $value, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
$content = preg_split('#(\[(?:\w|/\w).*?\])#ms', $value, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE );
foreach ($content as $cont)
{ // Each chunk is either a bbcode or a piece of text
@@ -448,11 +448,11 @@ class e_bbcode
foreach($mtch[1] as $i)
{
if(substr($i,0,4)=='http')
if(strpos($i,'http') === 0)
{
$ret[] = $i;
}
elseif(substr($i,0,3)=="{e_")
elseif(strpos($i,"{e_") === 0)
{
$ret[] = $tp->replaceConstants($i,'full');
}
@@ -827,7 +827,7 @@ class e_bbcode
if(substr($text,0,6)=='[html]')
if(strpos($text,'[html]') === 0)
{
return $text;
}