Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Convert deprecated split() usage to explode()
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardzyang committed Dec 8, 2008
1 parent 30fd03c commit 7a2e4f5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions 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 Expand Up @@ -625,4 +625,4 @@ protected function isLastPacket($packet) {
return ! $packet;
}
}
?>
?>
6 changes: 3 additions & 3 deletions 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 Expand Up @@ -547,4 +547,4 @@ static function getAllTopLevelDomains() {
return 'com|edu|net|org|gov|mil|int|biz|info|name|pro|aero|coop|museum';
}
}
?>
?>
6 changes: 3 additions & 3 deletions 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 Expand Up @@ -1492,4 +1492,4 @@ function getAssertionLine() {
return $trace->traceMethod();
}
}
?>
?>

0 comments on commit 7a2e4f5

Please sign in to comment.