MINOR Fixed use of split which is deprecated

This commit is contained in:
Sean Harvey 2012-04-10 21:44:10 +12:00
parent 1742b4b742
commit 4b2326cb66

View File

@ -316,7 +316,7 @@ class SimpleHttpHeaders {
$this->_cookies = array();
$this->_authentication = false;
$this->_realm = false;
foreach (split("\r\n", $headers) as $header_line) {
foreach (preg_split("/\r\n/", $headers) as $header_line) {
$this->_parseHeaderLine($header_line);
}
}
@ -457,7 +457,7 @@ class SimpleHttpHeaders {
* @access private
*/
function _parseCookie($cookie_line) {
$parts = split(";", $cookie_line);
$parts = preg_split('/;/', $cookie_line);
$cookie = array();
preg_match('/\s*(.*?)\s*=(.*)/', array_shift($parts), $cookie);
foreach ($parts as $part) {
@ -521,7 +521,7 @@ class SimpleHttpResponse extends SimpleStickyError {
$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) = preg_split("/\r\n\r\n/", $raw, 2);
$this->_headers = new SimpleHttpHeaders($headers);
}
}