From a3f2bd477e11eec54f89e8196603bf1a5d4d052e Mon Sep 17 00:00:00 2001 From: vargenau Date: Wed, 9 Jun 2010 10:06:37 +0000 Subject: [PATCH] split is deprecated, replace with explode git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@7506 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/IniConfig.php | 2 +- lib/PageList.php | 2 +- lib/WikiDB/adodb/drivers/adodb-informix72.inc.php | 4 ++-- lib/WikiDB/adodb/drivers/adodb-ldap.inc.php | 4 ++-- lib/WikiDB/adodb/drivers/adodb-postgres64.inc.php | 2 +- lib/WikiDB/backend.php | 2 +- lib/WikiUser/POP3.php | 2 +- lib/WikiUser/Session.php | 4 ++-- lib/WikiUserNew.php | 2 +- lib/XMLRPC/xmlrpc.inc | 4 ++-- lib/XmlParser.php | 4 ++-- lib/config.php | 6 +++--- lib/plugin/LdapSearch.php | 2 +- lib/plugin/ListPages.php | 2 +- lib/plugin/Template.php | 4 ++-- lib/wikilens/Utils.php | 2 +- lib/ziplib.php | 6 +++--- 17 files changed, 27 insertions(+), 27 deletions(-) diff --git a/lib/IniConfig.php b/lib/IniConfig.php index f6f57e5b9..368881ca3 100644 --- a/lib/IniConfig.php +++ b/lib/IniConfig.php @@ -425,7 +425,7 @@ function IniConfig($file) { if (defined('PLUGIN_MARKUP_MAP') and trim(PLUGIN_MARKUP_MAP) != "") { $_map = preg_split('/\s+/', PLUGIN_MARKUP_MAP); foreach ($_map as $v) { - list($xml,$plugin) = split(':', $v); + list($xml,$plugin) = explode(':', $v); if (!empty($xml) and !empty($plugin)) $PLUGIN_MARKUP_MAP[$xml] = $plugin; } diff --git a/lib/PageList.php b/lib/PageList.php index 1245b616d..61b690704 100644 --- a/lib/PageList.php +++ b/lib/PageList.php @@ -1395,7 +1395,7 @@ class PageList { return $limit; } if (strstr($limit, ',')) { - list($from, $limit) = split(',', $limit); + list($from, $limit) = explode(',', $limit); if ((!empty($from) && !is_numeric($from)) or (!empty($limit) && !is_numeric($limit))) { return $this->error(_("Illegal 'limit' argument: must be numeric")); } diff --git a/lib/WikiDB/adodb/drivers/adodb-informix72.inc.php b/lib/WikiDB/adodb/drivers/adodb-informix72.inc.php index f44b8a005..d96b908ef 100644 --- a/lib/WikiDB/adodb/drivers/adodb-informix72.inc.php +++ b/lib/WikiDB/adodb/drivers/adodb-informix72.inc.php @@ -312,7 +312,7 @@ class ADORecordset_informix72 extends ADORecordSet { foreach($fp as $k => $v) { $o = new ADOFieldObject; $o->name = $k; - $arr = split(';',$v); //"SQLTYPE;length;precision;scale;ISNULLABLE" + $arr = explode(';', $v); //"SQLTYPE;length;precision;scale;ISNULLABLE" $o->type = $arr[0]; $o->max_length = $arr[1]; $this->_fieldprops[] = $o; @@ -389,4 +389,4 @@ class ADORecordset_informix72 extends ADORecordSet { } } -?> \ No newline at end of file +?> diff --git a/lib/WikiDB/adodb/drivers/adodb-ldap.inc.php b/lib/WikiDB/adodb/drivers/adodb-ldap.inc.php index 809289907..dda2bd210 100644 --- a/lib/WikiDB/adodb/drivers/adodb-ldap.inc.php +++ b/lib/WikiDB/adodb/drivers/adodb-ldap.inc.php @@ -39,7 +39,7 @@ class ADODB_ldap extends ADOConnection { $conn_info = array( $host ); if ( strstr( $host, ':' ) ) { - $conn_info = split( ':', $host ); + $conn_info = explode(':', $host); } $this->_connectionID = ldap_connect( $conn_info[0], $conn_info[1] ) @@ -306,4 +306,4 @@ class ADORecordSet_ldap extends ADORecordSet{ } } -?> \ No newline at end of file +?> diff --git a/lib/WikiDB/adodb/drivers/adodb-postgres64.inc.php b/lib/WikiDB/adodb/drivers/adodb-postgres64.inc.php index 93c795f04..0c51a8cb1 100644 --- a/lib/WikiDB/adodb/drivers/adodb-postgres64.inc.php +++ b/lib/WikiDB/adodb/drivers/adodb-postgres64.inc.php @@ -571,7 +571,7 @@ WHERE c2.relname=\'%s\''; if (strlen($db) == 0) $db = 'template1'; $db = adodb_addslashes($db); if ($str) { - $host = split(":", $str); + $host = explode(":", $str); if ($host[0]) $str = "host=".adodb_addslashes($host[0]); else $str = 'host=localhost'; if (isset($host[1])) $str .= " port=$host[1]"; diff --git a/lib/WikiDB/backend.php b/lib/WikiDB/backend.php index cc4a44c4c..ccac4ab0a 100644 --- a/lib/WikiDB/backend.php +++ b/lib/WikiDB/backend.php @@ -525,7 +525,7 @@ class WikiDB_backend */ function limit($limit) { if (strstr($limit, ',')) { - list($from, $limit) = split(',', $limit); + list($from, $limit) = explode(',', $limit); if ((!empty($from) && !is_numeric($from)) or (!empty($limit) && !is_numeric($limit))) { return $this->error(_("Illegal 'limit' argument: must be numeric")); } diff --git a/lib/WikiUser/POP3.php b/lib/WikiUser/POP3.php index 8b7b75927..17fe4d5da 100644 --- a/lib/WikiUser/POP3.php +++ b/lib/WikiUser/POP3.php @@ -28,7 +28,7 @@ extends _IMAPPassUser { if (defined('POP3_AUTH_PORT')) $port = POP3_AUTH_PORT; elseif (strstr($host,':')) { - list(,$port) = split(':',$host); + list(,$port) = explode(':', $host); } else { $port = 110; } diff --git a/lib/WikiUser/Session.php b/lib/WikiUser/Session.php index 1df407cce..bb5e85c87 100644 --- a/lib/WikiUser/Session.php +++ b/lib/WikiUser/Session.php @@ -27,14 +27,14 @@ extends _PassUser if (strstr(AUTH_SESS_USER,"][")) { $sess = $GLOBALS['HTTP_SESSION_VARS']; // recurse into hashes: "[user][userid]", sess = sess[user] => sess = sess[userid] - foreach (split("][",AUTH_SESS_USER) as $v) { + foreach (explode("][", AUTH_SESS_USER) as $v) { $v = str_replace(array("[","]"),'',$v); $sess = $sess[$v]; } $this->_userid = $sess; } elseif (strstr(AUTH_SESS_USER,"->")) { // object "user->id" (no objects inside hashes supported!) - list($obj,$key) = split("->",AUTH_SESS_USER); + list($obj,$key) = explode("->", AUTH_SESS_USER); $this->_userid = $sess[$obj]->$key; } else { $this->_userid = $sess[AUTH_SESS_USER]; diff --git a/lib/WikiUserNew.php b/lib/WikiUserNew.php index 057b964be..c2583a427 100644 --- a/lib/WikiUserNew.php +++ b/lib/WikiUserNew.php @@ -1883,7 +1883,7 @@ function ValidateMail($email, $noconnect=false) { if ($noconnect) return array(true, sprintf(_("E-Mail address '%s' is properly formatted"), $email)); - list ( $Username, $Domain ) = split ("@", $email); + list ( $Username, $Domain ) = explode("@", $email); //Todo: getmxrr workaround on windows or manual input field to verify it manually if (!isWindows() and getmxrr($Domain, $MXHost)) { // avoid warning on Windows. $ConnectAddress = $MXHost[0]; diff --git a/lib/XMLRPC/xmlrpc.inc b/lib/XMLRPC/xmlrpc.inc index 5cafd1f38..6cc23ed1b 100644 --- a/lib/XMLRPC/xmlrpc.inc +++ b/lib/XMLRPC/xmlrpc.inc @@ -201,7 +201,7 @@ */ function xmlrpc_entity_decode($string) { - $top=split('&', $string); + $top=explode('&', $string); $op=''; $i=0; while($i_tag); if (is_string($attrs) and !empty($attrs)) { // lowercase attr names - foreach(split(' ',$attrs) as $pair) { + foreach(explode(' ', $attrs) as $pair) { if (strstr($pair,"=")) { - list($key,$val) = split('=',$pair); + list($key,$val) = explode('=', $pair); $key = strtolower(trim($key)); $val = str_replace(array('"',"'"),'',trim($val)); $node->_attr[$key] = $val; diff --git a/lib/config.php b/lib/config.php index 2adc8f19e..9c11f71fa 100644 --- a/lib/config.php +++ b/lib/config.php @@ -178,7 +178,7 @@ function guessing_setlocale ($category, $locale) { // do the reverse: return the detected locale collapsed to our LANG $locale = setlocale($category, ''); if ($locale) { - if (strstr($locale, '_')) list ($lang) = split('_', $locale); + if (strstr($locale, '_')) list ($lang) = explode('_', $locale); else $lang = $locale; if (strlen($lang) > 2) { foreach ($alt as $try => $locs) { @@ -193,7 +193,7 @@ function guessing_setlocale ($category, $locale) { if (strlen($locale) == 2) $lang = $locale; else - list ($lang) = split('_', $locale); + list ($lang) = explode('_', $locale); if (!isset($alt[$lang])) return false; @@ -228,7 +228,7 @@ function update_locale($loc) { $setlocale = guessing_setlocale(LC_ALL, $loc); // [56ms] if (!$setlocale) { // system has no locale for this language, so gettext might fail $setlocale = FileFinder::_get_lang(); - list ($setlocale,) = split('_', $setlocale, 2); + list ($setlocale,) = explode('_', $setlocale, 2); $setlocale = guessing_setlocale(LC_ALL, $setlocale); // try again if (!$setlocale) $setlocale = $loc; } diff --git a/lib/plugin/LdapSearch.php b/lib/plugin/LdapSearch.php index 2d9a0b40c..4fe01a0ef 100644 --- a/lib/plugin/LdapSearch.php +++ b/lib/plugin/LdapSearch.php @@ -135,7 +135,7 @@ extends WikiPlugin if (!$attributes) { $res = ldap_search($connect, $basedn, $filter); } else { - $attr_array = split (" ",$attributes); + $attr_array = explode(" ", $attributes); $res = ldap_search($connect, $basedn, $filter, $attr_array); } $entries = ldap_get_entries($connect, $res); diff --git a/lib/plugin/ListPages.php b/lib/plugin/ListPages.php index 93e9a47a3..02e56cb14 100644 --- a/lib/plugin/ListPages.php +++ b/lib/plugin/ListPages.php @@ -69,7 +69,7 @@ extends WikiPlugin if ($info == 'pagename' and isa($GLOBALS['WikiTheme'], 'wikilens')) $info .= ",top3recs"; if ($info) - $info = split(',', $info); + $info = explode(',', $info); else $info = array(); diff --git a/lib/plugin/Template.php b/lib/plugin/Template.php index eebc4ea45..4e42b7167 100644 --- a/lib/plugin/Template.php +++ b/lib/plugin/Template.php @@ -210,8 +210,8 @@ extends WikiPlugin $dbi =& $request->_dbi; $var = array(); if (is_string($vars) and !empty($vars)) { - foreach (split("&",$vars) as $pair) { - list($key,$val) = split("=",$pair); + foreach (explode("&", $vars) as $pair) { + list($key,$val) = explode("=", $pair); $var[$key] = $val; } } elseif (is_array($vars)) { diff --git a/lib/wikilens/Utils.php b/lib/wikilens/Utils.php index cd0634bb4..4cd5483a0 100644 --- a/lib/wikilens/Utils.php +++ b/lib/wikilens/Utils.php @@ -82,7 +82,7 @@ function getPageTextData($fromUser, $dbi, $START_DELIM, $DELIM) { $singles = $pageArray[$p]; $singles = substr($singles, strpos($singles, $START_DELIM) + strlen($START_DELIM)); - $retArray = split($DELIM, $singles); + $retArray = explode($DELIM, $singles); } for ($i = 0; $i < count($retArray); $i++) { $retArray[$i] = trim($retArray[$i]); diff --git a/lib/ziplib.php b/lib/ziplib.php index 9a33f0094..a554c0510 100644 --- a/lib/ziplib.php +++ b/lib/ziplib.php @@ -767,10 +767,10 @@ function ParseMimeifiedPerm($string) { return ''; } $hash = array(); - foreach (split(";",trim($string)) as $accessgroup) { - list($access,$groupstring) = split(":",trim($accessgroup)); + foreach (explode(";", trim($string)) as $accessgroup) { + list($access,$groupstring) = explode(":", trim($accessgroup)); $access = trim($access); - $groups = split(",",trim($groupstring)); + $groups = explode(",", trim($groupstring)); foreach ($groups as $group) { $group = trim($group); $bool = (boolean) (substr($group,0,1) != '-'); -- 2.45.0