From b2616ac46ddbc72ee3a03f13ee4d4ec746518274 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 10 Jul 2010 08:01:07 -0400 Subject: [PATCH] bug #3027557 [PHP] split() deprecated in PHP 5.3 (backport fixes from master, todo: update PHP excel?) --- ChangeLog | 2 ++ libraries/auth/swekey/swekey.auth.lib.php | 2 +- libraries/import/csv.php | 2 +- libraries/import/ldi.php | 2 +- server_synchronize.php | 8 ++++---- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 205dd326b..fc0822bb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug #3024344 [setup] Setup forces numeric MemoryLimit - bug #3025975 [auth] Odd LoginCookieValidity default value - bug #3026400 [PHP] ereg functions are deprecated +- bug #3027557 [PHP] split() deprecated in PHP 5.3 (backport fixes from +master, todo: update PHP excel?) 3.3.4.0 (2010-06-28) - bug #2996161 [import] properly escape import value diff --git a/libraries/auth/swekey/swekey.auth.lib.php b/libraries/auth/swekey/swekey.auth.lib.php index f1e7c583d..3dbad75d0 100644 --- a/libraries/auth/swekey/swekey.auth.lib.php +++ b/libraries/auth/swekey/swekey.auth.lib.php @@ -21,7 +21,7 @@ function Swekey_auth_check() if ($_SESSION['SWEKEY']['ENABLED'] && empty($_SESSION['SWEKEY']['CONF_LOADED'])) { $_SESSION['SWEKEY']['CONF_LOADED'] = true; $_SESSION['SWEKEY']['VALID_SWEKEYS'] = array(); - $valid_swekeys = split("\n",@file_get_contents($confFile)); + $valid_swekeys = explode("\n",@file_get_contents($confFile)); foreach ($valid_swekeys as $line) { if (preg_match("/^[0-9A-F]{32}:.+$/", $line) != false) { diff --git a/libraries/import/csv.php b/libraries/import/csv.php index f7ab3ed9a..193a6e170 100644 --- a/libraries/import/csv.php +++ b/libraries/import/csv.php @@ -101,7 +101,7 @@ if (!$analyze) { } else { $sql_template .= ' ('; $fields = array(); - $tmp = split(',( ?)', $csv_columns); + $tmp = preg_split('/,( ?)/', $csv_columns); foreach ($tmp as $key => $val) { if (count($fields) > 0) { $sql_template .= ', '; diff --git a/libraries/import/ldi.php b/libraries/import/ldi.php index 77ba0c1b9..f939a2d56 100644 --- a/libraries/import/ldi.php +++ b/libraries/import/ldi.php @@ -90,7 +90,7 @@ if ($skip_queries > 0) { } if (strlen($ldi_columns) > 0) { $sql .= ' ('; - $tmp = split(',( ?)', $ldi_columns); + $tmp = preg_split('/,( ?)/', $ldi_columns); $cnt_tmp = count($tmp); for ($i = 0; $i < $cnt_tmp; $i++) { if ($i > 0) { diff --git a/server_synchronize.php b/server_synchronize.php index 8e4a70158..a3c32660d 100644 --- a/server_synchronize.php +++ b/server_synchronize.php @@ -535,20 +535,20 @@ if (isset($_REQUEST['Table_ids'])) { for ($i = 0; isset($_REQUEST[$i]); $i++ ) { if (isset($_REQUEST[$i])) { - $table_id = split("US", $_REQUEST[$i]); + $table_id = explode("US", $_REQUEST[$i]); if (isset($table_id[1])) { $uncommon_table_structure_diff[] = $table_id[1]; } - $table_id = split("UD", $_REQUEST[$i]); + $table_id = explode("UD", $_REQUEST[$i]); if (isset($table_id[1])) { $uncommon_table_data_diff[] = $table_id[1]; } - $table_id = split("MS", $_REQUEST[$i]); + $table_id = explode("MS", $_REQUEST[$i]); if (isset($table_id[1])) { $matching_table_structure_diff[] = $table_id[1]; } - $table_id = split("MD", $_REQUEST[$i]); + $table_id = explode("MD", $_REQUEST[$i]); if (isset($table_id[1])) { $matching_table_data_diff[] = $table_id[1]; }