From a895042ae9f0ef058c395b756bfc0ba3c4a537c0 Mon Sep 17 00:00:00 2001 From: kink Date: Thu, 17 May 2007 16:36:13 +0000 Subject: [PATCH] replace preg_split without a regular expression with the faster and less complicated explode() git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12400 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_messages.php | 2 +- functions/plugin.php | 2 +- include/init.php | 2 +- plugins/filters/filters.php | 4 ++-- src/configtest.php | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/functions/imap_messages.php b/functions/imap_messages.php index c88daf5f..c0732aca 100755 --- a/functions/imap_messages.php +++ b/functions/imap_messages.php @@ -203,7 +203,7 @@ function parseUidList($aData,$sCommand) { for ($i=0,$iCnt=count($aData);$i<$iCnt;++$i) { for ($j=0,$jCnt=count($aData[$i]);$j<$jCnt;++$j) { if (preg_match("/^\* $sCommand (.+)$/", $aData[$i][$j], $aMatch)) { - $aUid += preg_split("/ /", trim($aMatch[1])); + $aUid += explode(' ', trim($aMatch[1])); } } } diff --git a/functions/plugin.php b/functions/plugin.php index 9deb5917..45495bc9 100644 --- a/functions/plugin.php +++ b/functions/plugin.php @@ -913,7 +913,7 @@ function check_plugin_dependencies($plugin_name, $force_inclusion = FALSE) foreach ($dependencies as $depend_name => $depend_requirements) { - $version = preg_split('/\./', $depend_requirements['version'], 3); + $version = explode('.', $depend_requirements['version'], 3); $version[0] = intval($version[0]); $version[1] = intval($version[1]); $version[2] = intval($version[2]); diff --git a/include/init.php b/include/init.php index 53cebad2..a06084b5 100644 --- a/include/init.php +++ b/include/init.php @@ -227,7 +227,7 @@ sqsession_is_active(); * SquirrelMail internal version number -- DO NOT CHANGE * $sm_internal_version = array (release, major, minor) */ -$SQM_INTERNAL_VERSION = preg_split('/\./', SM_VERSION, 3); +$SQM_INTERNAL_VERSION = explode('.', SM_VERSION, 3); $SQM_INTERNAL_VERSION[2] = intval($SQM_INTERNAL_VERSION[2]); diff --git a/plugins/filters/filters.php b/plugins/filters/filters.php index aefbf659..170a97de 100644 --- a/plugins/filters/filters.php +++ b/plugins/filters/filters.php @@ -381,7 +381,7 @@ function filter_search_and_delete($imap_stream, $where, $what, $where_to, $user_ $ids = array(); for ($i = 0, $iCnt = count($read); $i < $iCnt; ++$i) { if (preg_match("/^\* SEARCH (.+)$/", $read[$i], $regs)) { - $ids += preg_split("/ /", trim($regs[1])); + $ids += explode(' ', trim($regs[1])); } } if ($response == 'OK' && count($ids)) { @@ -450,7 +450,7 @@ function spam_filters($imap_stream) { if (isset($read[0])) { for ($i = 0, $iCnt = count($read); $i < $iCnt; ++$i) { if (preg_match("/^\* SEARCH (.+)$/", $read[$i], $regs)) { - $search_array = preg_split("/ /", trim($regs[1])); + $search_array = explode(' ', trim($regs[1])); break; } } diff --git a/src/configtest.php b/src/configtest.php index 274f9c98..d5a4fa2e 100644 --- a/src/configtest.php +++ b/src/configtest.php @@ -84,7 +84,7 @@ define('SM_PATH', '../'); require(SM_PATH . 'include/constants.php'); require(SM_PATH . 'functions/global.php'); require(SM_PATH . 'functions/strings.php'); -$SQM_INTERNAL_VERSION = preg_split('/\./', SM_VERSION, 3); +$SQM_INTERNAL_VERSION = explode('.', SM_VERSION, 3); $SQM_INTERNAL_VERSION[2] = intval($SQM_INTERNAL_VERSION[2]); /** set default value in order to block remote access */ -- 2.25.1