Skip to content

Commit

Permalink
Replaced remaining split depreciated functions into explode supported…
Browse files Browse the repository at this point in the history
… in php 5.3+
  • Loading branch information
rasseljandavid committed Jul 18, 2011
1 parent 5010e71 commit 9d6c7ff
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 18 deletions.
6 changes: 3 additions & 3 deletions external/Swift-4.0.5/test-suite/lib/simpletest/http.php
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ function __construct($headers) {
$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);
}
}
Expand Down Expand Up @@ -458,7 +458,7 @@ protected function parseHeaderLine($header_line) {
* @access private
*/
protected 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) {
Expand Down Expand Up @@ -525,7 +525,7 @@ protected function parse($raw) {
$this->setError('Could not split headers from content');
$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);
}
}
Expand Down
4 changes: 2 additions & 2 deletions external/Swift-4.0.5/test-suite/lib/simpletest/url.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected function chompLogin(&$url) {
}
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);
Expand Down Expand Up @@ -198,7 +198,7 @@ protected function chompRequest(&$url) {
protected function parseRequest($raw) {
$this->raw = $raw;
$request = new SimpleGetEncoding();
foreach (split("&", $raw) as $pair) {
foreach (explode("&", $raw) as $pair) {
if (preg_match('/(.*?)=(.*)/', $pair, $matches)) {
$request->add($matches[1], urldecode($matches[2]));
} elseif ($pair) {
Expand Down
4 changes: 2 additions & 2 deletions external/Swift-4.0.5/test-suite/lib/simpletest/web_tester.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function test($compare) {
* @access protected
*/
protected function findHeader($compare) {
$lines = split("\r\n", $compare);
$lines = explode("\r\n", $compare);
foreach ($lines as $line) {
if ($this->testHeaderLine($line)) {
return $line;
Expand All @@ -206,7 +206,7 @@ protected function findHeader($compare) {
* @access private
*/
protected function testHeaderLine($line) {
if (count($parsed = split(':', $line, 2)) < 2) {
if (count($parsed = explode(':', $line, 2)) < 2) {
return false;
}
list($header, $value) = $parsed;
Expand Down
1 change: 0 additions & 1 deletion external/ups-php/classes/class.ups.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ function getAvailableLayout($templateFile){
}
preg_match_all("/(\{.*?\})/",$buffer,$availArr);
$lines = file($templateFile);
// $items = split(' ',$lines[1]);
$items = explode(' ',$lines[1]);
$prefix = str_replace(array('<','>',"\n","\r"),'',$items[0]);
$x=0;
Expand Down
1 change: 0 additions & 1 deletion framework/core/controllers/expSimpleNoteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ private function sendNotification($simplenote) {

// setup some email variables.
$subject = 'Notification of a New Note Posted to '.URL_BASE;
// $tos = split(',', str_replace(' ', '', $notification_email));
$tos = explode(',', str_replace(' ', '', $notification_email));
$editlink = makelink(array('controller'=>'expSimpleNote', 'action'=>'edit', 'id'=>$simplenote->id));

Expand Down
1 change: 0 additions & 1 deletion framework/datatypes/keywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class keywords {
public function getAndWeightKeywords($text) {
if (empty($text)) return array();

// $words = split(' ', str_ireplace(self::getExcludedWords(), ' ', $text));
$words = explode(' ', str_ireplace(self::getExcludedWords(), ' ', $text));

foreach($words as $word) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ function process($method, $opts) {
$authorize = curl_exec($ch);
curl_close($ch);

// $response = split("\|", $authorize);
$response = explode("|", $authorize);

if ($response[0] == 1) { //Approved !!!
Expand Down Expand Up @@ -188,7 +187,7 @@ function credit_transaction($method, $amount) {
$authorize = curl_exec($ch);
curl_close($ch);

$response = split("|", $authorize);
$response = explode("|", $authorize);
if($response[2] == 1) { //if it is completed
$method->update(array('billing_options'=>serialize($billing_options), 'transaction_state'=>'voided'));
$this->createBillingTransaction($method, urldecode($response[9]),$billing_options->result,'voided');
Expand Down Expand Up @@ -228,7 +227,7 @@ function credit_transaction($method, $amount) {
$authorize = curl_exec($ch);
curl_close($ch);

$response = split("|", $authorize);
$response = explode("|", $authorize);

$method->update(array('billing_options'=>serialize($billing_options), 'transaction_state'=>'refunded'));
$this->createBillingTransaction($method, number_format($amount, 2, '.', ''),$billing_options->result,'refunded');
Expand Down
1 change: 0 additions & 1 deletion framework/modules/users/extensions/user_avatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public function update($params=array()) {
$info = expFile::getImageInfo($_FILES['avatar']['tmp_name']);
if ($info['is_image']) {
// figure out the mime type and set the file extension and name
// $extinfo = split('/',$info['mime']);
$extinfo = explode('/',$info['mime']);
$extension = $extinfo[1];
$avatar_name = $this->user_id.'.'.$extension;
Expand Down
2 changes: 1 addition & 1 deletion orphan_source_selector.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
if (isset($_REQUEST['showmodules'])) {
if (is_array($_REQUEST['showmodules'])) $source_select['showmodules'] = $_REQUEST['showmodules'];
else if ($_REQUEST['showmodules'] == 'all') $source_select['showmodules'] = null;
else $source_select['showmodules'] = split(',',$_REQUEST['showmodules']);
else $source_select['showmodules'] = explode(',',$_REQUEST['showmodules']);
} else if (!isset($source_select['showmodules'])) {
$source_select['showmodules'] = null;
}
Expand Down
1 change: 0 additions & 1 deletion subsystems/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ function exponent_config_parseFile($file) {
if ($line != "" && substr($line,0,2) != "<?" && substr($line,-2,2) != "?>") {
$line = str_replace(array("<?php","?>","<?",),"",$line);

// $opts = split("[\"'],",$line); // deprecated in php 5.3+
$opts = preg_split("/[\"'],/",$line);

if (count($opts) == 2) {
Expand Down
1 change: 0 additions & 1 deletion subsystems/database/postgres.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ function isValid() {

function connect($username,$password,$hostname,$database,$new = false) {
if( function_exists( 'pg_connect')){
// $host_data = split(":",$hostname);
$host_data = explode(":",$hostname);
$hostname = $host_data[0];
$port = $hostname[1];
Expand Down
1 change: 0 additions & 1 deletion subsystems/permissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ function exponent_permissions_initialize() {
*/
function exponent_permissions_getSourceUID($src) {
if (substr($src,0,5) == "@uid_") {
// $t = split("_",$src);
$t = explode("_",$src);
return $t[count($t)-1]+0;
} else return 0;
Expand Down

0 comments on commit 9d6c7ff

Please sign in to comment.