lib/pear MDL-20876 fix deprecated split() calls to use explode, str_split or preg_split

Author: Jonathan Harker <jonathan@catalyst.net.nz>
This commit is contained in:
Jonathan Harker 2010-07-20 01:16:55 +00:00
parent dbeee38cfc
commit fcbf4b6fac
5 changed files with 15 additions and 15 deletions

View File

@ -945,7 +945,7 @@ class HTML_QuickForm extends HTML_Common {
function updateElementAttr($elements, $attrs)
{
if (is_string($elements)) {
$elements = split('[ ]?,[ ]?', $elements);
$elements = preg_split('/[ ]?,[ ]?/', $elements);
}
foreach (array_keys($elements) as $key) {
if (is_object($elements[$key]) && is_a($elements[$key], 'HTML_QuickForm_element')) {
@ -1989,4 +1989,4 @@ class HTML_QuickForm_Error extends PEAR_Error {
// }}}
} // end class HTML_QuickForm_Error
?>
?>

View File

@ -105,7 +105,7 @@ class HTML_QuickForm_select extends HTML_QuickForm_element {
function setSelected($values)
{
if (is_string($values) && $this->getMultiple()) {
$values = split("[ ]?,[ ]?", $values);
$values = preg_split("/[ ]?,[ ]?/", $values);
}
if (is_array($values)) {
$this->_values = array_values($values);

View File

@ -215,7 +215,7 @@ abstract class PHP_CodeSniffer_CommentParser_AbstractParser
private function _parse($comment)
{
// Firstly, remove the comment tags and any stars from the left side.
$lines = split($this->phpcsFile->eolChar, $comment);
$lines = explode($this->phpcsFile->eolChar, $comment);
foreach ($lines as &$line) {
$line = trim($line);

View File

@ -669,9 +669,9 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
// Split the range into 2 cell refs
if (preg_match("/^([A-Ia-i]?[A-Za-z])(\d+)\:([A-Ia-i]?[A-Za-z])(\d+)$/", $range)) {
list($cell1, $cell2) = split(':', $range);
list($cell1, $cell2) = explode(':', $range);
} elseif (preg_match("/^([A-Ia-i]?[A-Za-z])(\d+)\.\.([A-Ia-i]?[A-Za-z])(\d+)$/", $range)) {
list($cell1, $cell2) = split('\.\.', $range);
list($cell1, $cell2) = explode('..', $range);
} else {
// TODO: use real error codes
@ -717,7 +717,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
$class = 2; // as far as I know, this is magick.
// Split the ref at the ! symbol
list($ext_ref, $range) = split('!', $token);
list($ext_ref, $range) = explode('!', $token);
// Convert the external reference part (different for BIFF8)
if ($this->_BIFF_version == 0x0500) {
@ -733,7 +733,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
}
// Split the range into 2 cell refs
list($cell1, $cell2) = split(':', $range);
list($cell1, $cell2) = explode(':', $range);
// Convert the cell references
if (preg_match("/^(\$)?[A-Ia-i]?[A-Za-z](\$)?(\d+)$/", $cell1)) {
@ -814,7 +814,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
$class = 2; // as far as I know, this is magick.
// Split the ref at the ! symbol
list($ext_ref, $cell) = split('!', $cell);
list($ext_ref, $cell) = explode('!', $cell);
// Convert the external reference part (different for BIFF8)
if ($this->_BIFF_version == 0x0500) {
@ -861,7 +861,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
// Check if there is a sheet range eg., Sheet1:Sheet2.
if (preg_match("/:/", $ext_ref)) {
list($sheet_name1, $sheet_name2) = split(':', $ext_ref);
list($sheet_name1, $sheet_name2) = explode(':', $ext_ref);
$sheet1 = $this->_getSheetIndex($sheet_name1);
if ($sheet1 == -1) {
@ -907,7 +907,7 @@ class Spreadsheet_Excel_Writer_Parser extends PEAR
// Check if there is a sheet range eg., Sheet1:Sheet2.
if (preg_match("/:/", $ext_ref)) {
list($sheet_name1, $sheet_name2) = split(':', $ext_ref);
list($sheet_name1, $sheet_name2) = explode(':', $ext_ref);
$sheet1 = $this->_getSheetIndex($sheet_name1);
if ($sheet1 == -1) {

View File

@ -1319,7 +1319,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr
$row = $match[2];
// Convert base26 column string to number
$chars = split('', $col);
$chars = str_split($col);
$expn = 0;
$col = 0;
@ -2038,7 +2038,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr
// parameters accordingly.
// Split the dir name and sheet name (if it exists)
/*if (preg_match("/\#/", $url)) {
list($dir_long, $sheet) = split("\#", $url);
list($dir_long, $sheet) = explode("#", $url);
} else {
$dir_long = $url;
}
@ -2046,7 +2046,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr
if (isset($sheet)) {
$link_type |= 0x08;
$sheet_len = pack("V", strlen($sheet) + 0x01);
$sheet = join("\0", split('', $sheet));
$sheet = join("\0", str_split($sheet));
$sheet .= "\0\0\0";
} else {
$sheet_len = '';
@ -2070,7 +2070,7 @@ class Spreadsheet_Excel_Writer_Worksheet extends Spreadsheet_Excel_Writer_BIFFwr
$dir_short = preg_replace("/\.\.\\\/", '', $dir_long) . "\0";
// Store the long dir name as a wchar string (non-null terminated)
//$dir_long = join("\0", split('', $dir_long));
//$dir_long = join("\0", str_split($dir_long));
$dir_long = $dir_long . "\0";
// Pack the lengths of the dir strings