From 83e5f89a44b5e75bad70529a8941966f300a23a2 Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Tue, 20 Apr 2010 18:06:29 +1200 Subject: [PATCH] Replace deprecated split() calls. --- inc/Session.php | 9 +++++---- inc/classEditor.php | 2 +- inc/iCalendar.php | 4 ++-- inc/vEvent.php | 6 +++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/inc/Session.php b/inc/Session.php index 7e10ee1..3131a03 100644 --- a/inc/Session.php +++ b/inc/Session.php @@ -437,11 +437,11 @@ class Session global $c; dbg_error_log( "Login", " LSIDLogin: Attempting login for $lsid" ); - list($md5_user_no,$validation_string) = split( ';', $lsid ); + list($md5_user_no,$validation_string) = explode( ';', $lsid ); $qry = new PgQuery( "SELECT * FROM usr WHERE md5(user_no::text)=?;", $md5_user_no ); if ( $qry->Exec('Login') && $qry->rows() == 1 ) { $usr = $qry->Fetch(); - list( $x, $salt, $y) = split('\*', $validation_string); + list( $x, $salt, $y) = explode('*', $validation_string); $my_validation = session_salted_md5($usr->user_no . $usr->username . $usr->password, $salt); if ( $validation_string == $my_validation ) { // Now get the next session ID to create one from... @@ -602,7 +602,7 @@ EOTEXT; } } else { - $valid_groups = split(",", $groups); + $valid_groups = explode(",", $groups); foreach( $valid_groups AS $k => $v ) { if ( $this->AllowedTo($v) ) return; } @@ -654,6 +654,7 @@ EOTEXT; $mail = new EMail( "Access to $c->system_name" ); $mail->SetFrom($c->admin_email ); $usernames = ""; + $debug_to = ""; if ( isset($c->debug_email) ) { $debug_to = "This e-mail would normally be sent to:\n "; $mail->AddTo( "Tester <$c->debug_email>" ); @@ -817,7 +818,7 @@ EOTEXT; * Perhaps this 'split' is not a good idea though. People may want to use the * full ID as the username. A further option may be desirable. */ - list($username) = split('@', $_SERVER['REMOTE_USER']); + list($username) = explode('@', $_SERVER['REMOTE_USER']); $this->Login($username, "", true); // Password will not be checked. } } diff --git a/inc/classEditor.php b/inc/classEditor.php index 0d2ef12..2b71815 100644 --- a/inc/classEditor.php +++ b/inc/classEditor.php @@ -416,7 +416,7 @@ class Editor $size = (isset($part3) ? $part3 : 10); return ""; case "textarea": - list( $cols, $rows ) = split( 'x', $part3); + list( $cols, $rows ) = explode( 'x', $part3); return ""; case "hidden": return sprintf( "", htmlspecialchars($field_value) ); diff --git a/inc/iCalendar.php b/inc/iCalendar.php index 1554f7b..b193acc 100644 --- a/inc/iCalendar.php +++ b/inc/iCalendar.php @@ -1169,9 +1169,9 @@ class iCalendar { // DEPRECATED } else { // Parse the property - @list( $property, $value ) = preg_split('/:/', $line, 2 ); + @list( $property, $value ) = explode(':', $line, 2 ); if ( strpos( $property, ';' ) > 0 ) { - $parameterlist = preg_split('/;/', $property ); + $parameterlist = explode(';', $property ); $property = array_shift($parameterlist); foreach( $parameterlist AS $pk => $pv ) { if ( $pv == "VALUE=DATE" ) { diff --git a/inc/vEvent.php b/inc/vEvent.php index 3650016..9ac9048 100644 --- a/inc/vEvent.php +++ b/inc/vEvent.php @@ -124,9 +124,9 @@ class vEvent { } if ( ($state == 'BEGIN:VEVENT' || $state == 'BEGIN:VTODO') && $state != $v ) { - list( $property, $value ) = preg_split('/:/', $v, 2 ); + list( $property, $value ) = explode(':', $v, 2 ); if ( strpos( $property, ';' ) > 0 ) { - $parameterlist = preg_split('/;/', $v ); + $parameterlist = explode(';', $v ); $property = array_shift($parameterlist); foreach( $parameterlist AS $pk => $pv ) { if ( preg_match('/^TZID=(.*)$/', $pv, $matches) ) { @@ -141,7 +141,7 @@ class vEvent { } if ( $state == 'BEGIN:VTIMEZONE' ) { $vtimezone .= $v . "\n"; - @list( $parameter, $value ) = preg_split('/:/', $v ); + @list( $parameter, $value ) = explode(':', $v ); if ( !isset($this->tz_locn) && $parameter == 'X-LIC-LOCATION' ) { $this->tz_locn = $value; } -- 2.11.4.GIT