Permalink
Browse files

Replaced regex with string split.

  • Loading branch information...
1 parent 21e3ba2 commit 54ae1fbb353bff575a20f0b72d4a06ecae35d016 Anton Lindqvist committed Mar 21, 2011
Showing with 3 additions and 5 deletions.
  1. +3 −5 Services/Soundcloud.php
View
@@ -502,9 +502,7 @@ function delete($path, $params = array(), $curlOptions = array()) {
* @see Soundcloud::_request()
*/
function download($trackId, $params = array(), $curlOptions = array()) {
- $lastResponseFormat = array_pop(
- preg_split('/\//', $this->getResponseFormat())
- );
+ $lastResponseFormat = array_pop(explode('/', $this->getResponseFormat()));
$defaultParams = array('oauth_token' => $this->getAccessToken());
$defaultCurlOptions = array(
CURLOPT_FOLLOWLOCATION => true,
@@ -619,15 +617,15 @@ protected function _getUserAgent() {
* @return array
*/
protected function _parseHttpHeaders($headers) {
- $headers = preg_split('/\n/', trim($headers));
+ $headers = explode("\n", trim($headers));
$parsedHeaders = array();
foreach ($headers as $header) {
if (!preg_match('/\:\s/', $header)) {
continue;
}
- list($key, $val) = preg_split('/\:\s/', $header, 2);
+ list($key, $val) = explode(': ', $header, 2);
$key = str_replace('-', '_', strtolower($key));
$val = trim($val);

0 comments on commit 54ae1fb

Please sign in to comment.