From 575dd9be519a557c47e1288eaa15b1e1446dd058 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Fri, 30 Sep 2005 09:23:26 +0000 Subject: [PATCH] newsflash : split is not explode .... git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@70 839d8a87-29fc-0310-9880-83ba4fa771e5 --- bin/emails.broken.php | 2 +- htdocs.net/groupe/alias-admin.php | 2 +- htdocs.net/groupe/membres-edit.php | 4 ++-- htdocs/TESTS/simpletest/http.php | 8 ++++---- htdocs/TESTS/simpletest/url.php | 6 +++--- htdocs/TESTS/simpletest/web_tester.php | 6 +++--- htdocs/auth-groupex.php | 4 ++-- htdocs/emails/broken.php | 2 +- htdocs/emails/redirect.php | 2 +- htdocs/listes/trombi.php | 2 +- htdocs/webservices/manageurs.php | 2 +- include/lists.inc.php | 2 +- include/newsletter.inc.php | 2 +- include/user.func.inc.php | 4 ++-- include/xnet/mail.inc.php | 2 +- 15 files changed, 25 insertions(+), 25 deletions(-) diff --git a/bin/emails.broken.php b/bin/emails.broken.php index c33f69b..9614485 100755 --- a/bin/emails.broken.php +++ b/bin/emails.broken.php @@ -31,7 +31,7 @@ if (($opts['i'] && $opts['i'] == '-') || empty($opts['i'])) { $file = $opts['i']; } -$emails = split("\n", file_get_contents($file)); +$emails = explode("\n", file_get_contents($file)); foreach ($emails as $_email) { $email = valide_email($_email); if (empty($email) || $email=='@') { diff --git a/htdocs.net/groupe/alias-admin.php b/htdocs.net/groupe/alias-admin.php index 2ef9b37..26dcab5 100644 --- a/htdocs.net/groupe/alias-admin.php +++ b/htdocs.net/groupe/alias-admin.php @@ -12,7 +12,7 @@ $lfull = strtolower(Get::get('liste')); if (Env::has('add_member')) { $add = Env::get('add_member'); if(strstr($add, '@')) { - list($mbox,$dom) = split('@', strtolower($add)); + list($mbox,$dom) = explode('@', strtolower($add)); } else { $mbox = $add; $dom = 'm4x.org'; diff --git a/htdocs.net/groupe/membres-edit.php b/htdocs.net/groupe/membres-edit.php index 6aca99d..fa13502 100644 --- a/htdocs.net/groupe/membres-edit.php +++ b/htdocs.net/groupe/membres-edit.php @@ -10,7 +10,7 @@ if (strpos($email, '@') === false) { $email .= '@m4x.org'; } - list($mbox,$dom) = split('@', $email); + list($mbox,$dom) = explode('@', $email); $res = $globals->xdb->query( "SELECT uid, nom, prenom, email, email AS email2, perms='admin', origine @@ -42,7 +42,7 @@ if (Env::has('email')) { $email = Env::get('email'); - list(,$fqdn) = split('@', $email); + list(,$fqdn) = explode('@', $email); $fqdn = strtolower($fqdn); if ($fqdn == 'polytechnique.org' || $fqdn == 'melix.org' || $fqdn == 'm4x.org' || $fqdn == 'melix.net') diff --git a/htdocs/TESTS/simpletest/http.php b/htdocs/TESTS/simpletest/http.php index bea9658..8a6ea87 100644 --- a/htdocs/TESTS/simpletest/http.php +++ b/htdocs/TESTS/simpletest/http.php @@ -569,7 +569,7 @@ $this->_cookies = array(); $this->_authentication = false; $this->_realm = false; - foreach (split("\r\n", $headers) as $header_line) { + foreach (explode("\r\n", $headers) as $header_line) { $this->_parseHeaderLine($header_line); } } @@ -702,7 +702,7 @@ * @access private */ function _parseCookie($cookie_line) { - $parts = split(";", $cookie_line); + $parts = explode(";", $cookie_line); $cookie = array(); preg_match('/\s*(.*?)\s*=(.*)/', array_shift($parts), $cookie); foreach ($parts as $part) { @@ -769,7 +769,7 @@ $this->_setError('Could not parse headers'); $this->_headers = &new SimpleHttpHeaders($raw); } else { - list($headers, $this->_content) = split("\r\n\r\n", $raw, 2); + list($headers, $this->_content) = explode("\r\n\r\n", $raw, 2); $this->_headers = &new SimpleHttpHeaders($headers); } } @@ -869,4 +869,4 @@ return ! $packet; } } -?> \ No newline at end of file +?> diff --git a/htdocs/TESTS/simpletest/url.php b/htdocs/TESTS/simpletest/url.php index d0378ed..e9f4a15 100644 --- a/htdocs/TESTS/simpletest/url.php +++ b/htdocs/TESTS/simpletest/url.php @@ -216,7 +216,7 @@ } if (preg_match('/(.*?)@(.*)/', $url, $matches)) { $url = $prefix . $matches[2]; - $parts = split(":", $matches[1]); + $parts = explode(":", $matches[1]); return array( urldecode($parts[0]), isset($parts[1]) ? urldecode($parts[1]) : false); @@ -292,7 +292,7 @@ */ function _parseRequest($raw) { $request = new SimpleQueryString(); - foreach (split("&", $raw) as $pair) { + foreach (explode("&", $raw) as $pair) { if (preg_match('/(.*?)=(.*)/', $pair, $matches)) { $request->add($matches[1], urldecode($matches[2])); } elseif ($pair) { @@ -618,4 +618,4 @@ return preg_replace('|/\./|', '/', $path); } } -?> \ No newline at end of file +?> diff --git a/htdocs/TESTS/simpletest/web_tester.php b/htdocs/TESTS/simpletest/web_tester.php index baecfa3..d1bacb6 100644 --- a/htdocs/TESTS/simpletest/web_tester.php +++ b/htdocs/TESTS/simpletest/web_tester.php @@ -182,7 +182,7 @@ * @access protected */ function _findHeader($compare) { - $lines = split("\r\n", $compare); + $lines = explode("\r\n", $compare); foreach ($lines as $line) { if ($this->_testHeaderLine($line)) { return $line; @@ -198,7 +198,7 @@ * @access private */ function _testHeaderLine($line) { - if (count($parsed = split(':', $line)) < 2) { + if (count($parsed = explode(':', $line)) < 2) { return false; } list($header, $value) = $parsed; @@ -1096,4 +1096,4 @@ sprintf($message, "Not expecting cookie [$name]")); } } -?> \ No newline at end of file +?> diff --git a/htdocs/auth-groupex.php b/htdocs/auth-groupex.php index 4c78598..09ec9d4 100644 --- a/htdocs/auth-groupex.php +++ b/htdocs/auth-groupex.php @@ -43,7 +43,7 @@ if (!isset($_SESSION['suid'])) { /* cree le champs "auth" renvoye au Groupe X */ function gpex_make_auth($chlg, $privkey, $datafields) { global $globals; - $fieldarr = split(",",$datafields); + $fieldarr = explode(",",$datafields); $tohash = "1$chlg$privkey"; while (list(,$val) = each($fieldarr)) { @@ -65,7 +65,7 @@ function gpex_make_auth($chlg, $privkey, $datafields) { function gpex_make_params($chlg, $privkey, $datafields) { global $globals; $params = "&auth=".gpex_make_auth($chlg, $privkey, $datafields); - $fieldarr = split(",",$datafields); + $fieldarr = explode(",",$datafields); while (list(,$val) = each($fieldarr)) { if (isset($_SESSION[$val])) { $params .= "&$val=".$_SESSION[$val]; diff --git a/htdocs/emails/broken.php b/htdocs/emails/broken.php index 1710f79..ce6e7b2 100644 --- a/htdocs/emails/broken.php +++ b/htdocs/emails/broken.php @@ -66,7 +66,7 @@ L' } elseif (Post::has('email')) { $email = valide_email(Post::get('email')); - list(,$fqdn) = split('@', $email); + list(,$fqdn) = explode('@', $email); $fqdn = strtolower($fqdn); if ($fqdn == 'polytechnique.org' || $fqdn == 'melix.org' || $fqdn == 'm4x.org' || $fqdn == 'melix.net') { $page->assign('neuneu', true); diff --git a/htdocs/emails/redirect.php b/htdocs/emails/redirect.php index cff20d9..61e0710 100644 --- a/htdocs/emails/redirect.php +++ b/htdocs/emails/redirect.php @@ -49,7 +49,7 @@ $res = $globals->xdb->query( $forlife.'@'.$globals->mail->domain, $forlife.'@'.$globals->mail->domain2); $melix = $res->fetchOneCell(); if ($melix) { - list($melix) = split('@', $melix); + list($melix) = explode('@', $melix); $page->assign('melix',$melix); } diff --git a/htdocs/listes/trombi.php b/htdocs/listes/trombi.php index 97638fe..8021c65 100644 --- a/htdocs/listes/trombi.php +++ b/htdocs/listes/trombi.php @@ -46,7 +46,7 @@ function getList($offset,$limit) $membres = Array(); foreach ($members as $member) { - list($m) = split('@',$member[1]); + list($m) = explode('@',$member[1]); $res = $globals->xdb->query("SELECT prenom,IF(nom_usage='', nom, nom_usage) AS nom, promo, a.alias AS forlife FROM auth_user_md5 AS u INNER JOIN aliases AS a ON u.user_id = a.id diff --git a/htdocs/webservices/manageurs.php b/htdocs/webservices/manageurs.php index 237989b..f24329f 100644 --- a/htdocs/webservices/manageurs.php +++ b/htdocs/webservices/manageurs.php @@ -22,7 +22,7 @@ require_once('xorg.inc.php'); require_once('webservices/manageurs.server.inc.php'); -$ips = array_flip(split(' ',$globals->manageurs->authorized_ips)); +$ips = array_flip(explode(' ',$globals->manageurs->authorized_ips)); if($ips && isset($ips[$_SERVER['REMOTE_ADDR']])){ $server = xmlrpc_server_create(); diff --git a/include/lists.inc.php b/include/lists.inc.php index 4d438c7..55fca23 100644 --- a/include/lists.inc.php +++ b/include/lists.inc.php @@ -45,7 +45,7 @@ function list_sort_owners(&$members, $tri_promo = true) { $membres = Array(); foreach($members as $mem) { - list($m, $dom) = split('@',$mem); + list($m, $dom) = explode('@',$mem); if ($dom == $globals->mail->domain || $dom == $globals->mail->domain2) { $res = $globals->xdb->query('SELECT prenom,IF(nom_usage="", nom, nom_usage), promo FROM auth_user_md5 AS u diff --git a/include/newsletter.inc.php b/include/newsletter.inc.php index 63e0b2e..9e960d3 100644 --- a/include/newsletter.inc.php +++ b/include/newsletter.inc.php @@ -479,7 +479,7 @@ function subscribe_nl($uid=-1) function justify($text,$n) { - $arr = split("\n",wordwrap($text,$n)); + $arr = explode("\n",wordwrap($text,$n)); $arr = array_map('trim',$arr); $res = ''; foreach ($arr as $key => $line) { diff --git a/include/user.func.inc.php b/include/user.func.inc.php index 7f440e0..8f4fa6a 100644 --- a/include/user.func.inc.php +++ b/include/user.func.inc.php @@ -87,7 +87,7 @@ function get_user_login($data, $get_forlife = false) { $data = $data.'@'.$globals->mail->domain; } - list($mbox, $fqdn) = split('@', $data); + list($mbox, $fqdn) = explode('@', $data); if ($fqdn == $globals->mail->domain || $fqdn == $globals->mail->domain2) { $res = $globals->xdb->query("SELECT a.alias @@ -108,7 +108,7 @@ function get_user_login($data, $get_forlife = false) { INNER JOIN virtual USING(vid) WHERE alias={?}", $mbox.'@'.$globals->mail->alias_dom); if ($redir = $res->fetchOneCell()) { - list($alias) = split('@', $redir); + list($alias) = explode('@', $redir); } else { $page->trig("il n'y a pas d'utilisateur avec cet alias"); $alias = false; diff --git a/include/xnet/mail.inc.php b/include/xnet/mail.inc.php index 9380a79..f1f05d6 100644 --- a/include/xnet/mail.inc.php +++ b/include/xnet/mail.inc.php @@ -45,7 +45,7 @@ function get_all_redirects($membres, $mls, &$client) foreach ($mls as $ml) { if (list(,$members) = $client->get_members($ml)) { foreach ($members as $mem) { - list($m, $dom) = split('@',$mem[1]); + list($m, $dom) = explode('@',$mem[1]); if ($dom == $globals->mail->domain || $dom == $globals->mail->domain2) { $res = $globals->xdb->query('SELECT prenom, nom, FIND_IN_SET("femme", u.flags) AS sexe FROM auth_user_md5 AS u -- 2.1.4