replace preg_split without a regular expression with the
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 17 May 2007 16:36:13 +0000 (16:36 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 17 May 2007 16:36:13 +0000 (16:36 +0000)
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
functions/plugin.php
include/init.php
plugins/filters/filters.php
src/configtest.php

index c88daf5fde5c1eec515a5f2dc30ee3aa97dfdb80..c0732acae4a7c01f61b3f04e0d9223fd5962730c 100755 (executable)
@@ -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]));
                 }
             }
         }
index 9deb591733640ce73b93850028a4e2438faa94c2..45495bc9c62de7dce152b5e7177e2e5c0ef92508 100644 (file)
@@ -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]);
index 53cebad214d7bf98d324108531c20d273165f80b..a06084b58558a20b8f9b2aee902e2dc499812614 100644 (file)
@@ -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]);
 
 
index aefbf659add4e7767357fced35c1fbf8e960c6c2..170a97de0ea81af4ca880892c6f4c68216248416 100644 (file)
@@ -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;
                 }
             }
index 274f9c98dbfab898b4d9cf383f0c4dc2e227050e..d5a4fa2ed7858843353df2d59cfe09cfd5775ecf 100644 (file)
@@ -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 */