diff --git a/inc/auth.php b/inc/auth.php index 23031a29cbd1297929cd8aec1e983a8c9b865b0a..d497c89d62344d79490813485398094590c4abbf 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -166,7 +166,7 @@ function auth_login($user,$pass,$sticky=false,$silent=false){ }else{ // read cookie information $cookie = base64_decode($_COOKIE[DOKU_COOKIE]); - list($user,$sticky,$pass) = split('\|',$cookie,3); + list($user,$sticky,$pass) = explode('|',$cookie,3); // get session info $session = $_SESSION[DOKU_COOKIE]['auth']; if($user && $pass){ @@ -744,7 +744,7 @@ function updateprofile() { if ($result = $auth->triggerUserMod('modify', array($_SERVER['REMOTE_USER'], $changes))) { // update cookie and session with the changed data $cookie = base64_decode($_COOKIE[DOKU_COOKIE]); - list($user,$sticky,$pass) = split('\|',$cookie,3); + list($user,$sticky,$pass) = explode('|',$cookie,3); if ($changes['pass']) $pass = PMA_blowfish_encrypt($changes['pass'],auth_cookiesalt()); auth_setCookie($_SERVER['REMOTE_USER'],$pass,(bool)$sticky); diff --git a/inc/auth/plain.class.php b/inc/auth/plain.class.php index 02175d962c4330aa6531355441cabe5f52c523e3..68976287aa3e18bfcea36b9b7c14664bede589ef 100644 --- a/inc/auth/plain.class.php +++ b/inc/auth/plain.class.php @@ -278,8 +278,8 @@ class auth_plain extends auth_basic { $line = trim($line); if(empty($line)) continue; - $row = split(":",$line,5); - $groups = split(",",$row[4]); + $row = explode(":",$line,5); + $groups = array_values(array_filter(explode(",",$row[4]))); $this->users[$row[0]]['pass'] = $row[1]; $this->users[$row[0]]['name'] = urldecode($row[2]); diff --git a/inc/common.php b/inc/common.php index dfc563b7fb93b8708ee98ee939e33b1a6f7fafff..5c95115a6058a472afdcb72592f069fafc71e15a 100644 --- a/inc/common.php +++ b/inc/common.php @@ -884,7 +884,7 @@ function pageTemplate($data){ * @author Andreas Gohr <andi@splitbrain.org> */ function rawWikiSlices($range,$id,$rev=''){ - list($from,$to) = split('-',$range,2); + list($from,$to) = explode('-',$range,2); $text = io_readWikiPage(wikiFN($id, $rev), $id, $rev); if(!$from) $from = 0; if(!$to) $to = strlen($text)+1; @@ -1101,8 +1101,8 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ $subject = $lang['mail_changed'].' '.$id; $text = str_replace('@OLDPAGE@',wl($id,"rev=$rev",true,'&'),$text); require_once(DOKU_INC.'inc/DifferenceEngine.php'); - $df = new Diff(split("\n",rawWiki($id,$rev)), - split("\n",rawWiki($id))); + $df = new Diff(explode("\n",rawWiki($id,$rev)), + explode("\n",rawWiki($id))); $dformat = new UnifiedDiffFormatter(); $diff = $dformat->format($df); }else{ diff --git a/inc/mail.php b/inc/mail.php index f127ea9892bb8e47c2ab9d83ba0be6367fbd3767..61d938cf888ef6d572e168c347b845b3e759e7a0 100644 --- a/inc/mail.php +++ b/inc/mail.php @@ -125,7 +125,7 @@ function _mail_send_action($data) { */ function mail_encode_address($string,$header='',$names=true){ $headers = ''; - $parts = split(',',$string); + $parts = explode(',',$string); foreach ($parts as $part){ $part = trim($part); diff --git a/inc/pageutils.php b/inc/pageutils.php index c10272af398c5dd042c36e665e14c4c48beaab71..65b140ea30d2c1dbcc2553c22adce11432579899 100644 --- a/inc/pageutils.php +++ b/inc/pageutils.php @@ -435,7 +435,7 @@ function resolve_pageid($ns,&$page,&$exists){ //keep hashlink if exists then clean both parts if (strpos($page,'#')) { - list($page,$hash) = split('#',$page,2); + list($page,$hash) = explode('#',$page,2); } else { $hash = ''; } diff --git a/inc/parser/handler.php b/inc/parser/handler.php index 5bcb3c2f09731c8491c359624ae90432969430cc..83f837b70359fcecf6643b95b8a83802235bdb3d 100644 --- a/inc/parser/handler.php +++ b/inc/parser/handler.php @@ -363,7 +363,7 @@ class Doku_Handler { function code($match, $state, $pos) { switch ( $state ) { case DOKU_LEXER_UNMATCHED: - $matches = preg_split('/>/u',$match,2); + $matches = explode('>',$match,2); $matches[0] = trim($matches[0]); if ( trim($matches[0]) == '' ) { $matches[0] = NULL; @@ -444,7 +444,7 @@ class Doku_Handler { $link = preg_replace(array('/^\[\[/','/\]\]$/u'),'',$match); // Split title from URL - $link = preg_split('/\|/u',$link,2); + $link = explode('|',$link,2); if ( !isset($link[1]) ) { $link[1] = NULL; } else if ( preg_match('/^\{\{[^\}]+\}\}$/',$link[1]) ) { @@ -457,7 +457,7 @@ class Doku_Handler { if ( preg_match('/^[a-zA-Z0-9\.]+>{1}.*$/u',$link[0]) ) { // Interwiki - $interwiki = preg_split('/>/u',$link[0]); + $interwiki = explode('>',$link[0],2); $this->_addCall( 'interwikilink', array($link[0],$link[1],strtolower($interwiki[0]),$interwiki[1]), @@ -638,7 +638,7 @@ function Doku_Handler_Parse_Media($match) { $link = preg_replace(array('/^\{\{/','/\}\}$/u'),'',$match); // Split title from URL - $link = preg_split('/\|/u',$link,2); + $link = explode('|',$link,2); // Check alignment @@ -997,7 +997,9 @@ class Doku_Handler_List { } else { $type = 'o'; } - return count(explode(' ',str_replace("\t",' ',$match))); + // Is the +1 needed? It used to be count(explode(...)) + // but I don't think the number is seen outside this handler + return substr_count(str_replace("\t",' ',$match), ' ') + 1; } } diff --git a/inc/parser/lexer.php b/inc/parser/lexer.php index 86e818d9ce27eadc58d4110ca5cb087c00399f53..d2aaf407b166724d050a0d261f76c5dd42f75295 100644 --- a/inc/parser/lexer.php +++ b/inc/parser/lexer.php @@ -513,7 +513,7 @@ class Doku_Lexer { // modes starting with plugin_ are all handled by the same // handler but with an additional parameter if(substr($handler,0,7)=='plugin_'){ - list($handler,$plugin) = split('_',$handler,2); + list($handler,$plugin) = explode('_',$handler,2); return $this->_parser->$handler($content, $is_match, $pos, $plugin); } diff --git a/inc/parser/metadata.php b/inc/parser/metadata.php index 79d774106491c20157cc6d7c016fb3da6f4d0f66..88d531af1b960e7e4cd1325401806d42a4ddef1c 100644 --- a/inc/parser/metadata.php +++ b/inc/parser/metadata.php @@ -315,7 +315,7 @@ class Doku_Renderer_metadata extends Doku_Renderer { // first resolve and clean up the $id resolve_pageid(getNS($ID), $id, $exists); - list($page, $hash) = split('#', $id, 2); + list($page, $hash) = explode('#', $id, 2); // set metadata $this->meta['relation']['references'][$page] = $exists;