Skip to content
This repository
Browse code

MINOR Fixed use of split which is deprecated

  • Loading branch information...
commit 4b2326cb668b7afdcc57db2eadfdd7b54e3a7a68 1 parent 1742b4b
Sean Harvey authored April 10, 2012

Showing 1 changed file with 3 additions and 3 deletions. Show diff stats Hide diff stats

  1. 6  thirdparty/simpletest/http.php
6  thirdparty/simpletest/http.php
@@ -316,7 +316,7 @@ function SimpleHttpHeaders($headers) {
316 316
         $this->_cookies = array();
317 317
         $this->_authentication = false;
318 318
         $this->_realm = false;
319  
-        foreach (split("\r\n", $headers) as $header_line) {
  319
+        foreach (preg_split("/\r\n/", $headers) as $header_line) {
320 320
             $this->_parseHeaderLine($header_line);
321 321
         }
322 322
     }
@@ -457,7 +457,7 @@ function _parseHeaderLine($header_line) {
457 457
      *    @access private
458 458
      */
459 459
     function _parseCookie($cookie_line) {
460  
-        $parts = split(";", $cookie_line);
  460
+        $parts = preg_split('/;/', $cookie_line);
461 461
         $cookie = array();
462 462
         preg_match('/\s*(.*?)\s*=(.*)/', array_shift($parts), $cookie);
463 463
         foreach ($parts as $part) {
@@ -521,7 +521,7 @@ function _parse($raw) {
521 521
             $this->_setError('Could not split headers from content');
522 522
             $this->_headers = new SimpleHttpHeaders($raw);
523 523
         } else {
524  
-            list($headers, $this->_content) = split("\r\n\r\n", $raw, 2);
  524
+            list($headers, $this->_content) = preg_split("/\r\n\r\n/", $raw, 2);
525 525
             $this->_headers = new SimpleHttpHeaders($headers);
526 526
         }
527 527
     }

0 notes on commit 4b2326c

Please sign in to comment.
Something went wrong with that request. Please try again.