Permalink
Browse files

Removed reset pointer array as not needed for foreach

  • Loading branch information...
1 parent 6d0e1de commit 3682d1334fbbbab16fb532639e131af3f75427ec unknown committed Aug 14, 2011
Showing with 2 additions and 5 deletions.
  1. +2 −5 catalog/includes/classes/http_client.php
@@ -100,7 +100,6 @@ function setCredentials($username, $password) {
**/
function setHeaders($headers) {
if (is_array($headers)) {
- reset($headers);
foreach($headers as $name => $value) {
$this->requestHeaders[$name] = $value;
}
@@ -202,8 +201,7 @@ function Post($uri, $query_params = '') {
if (is_array($query_params)) {
$postArray = array();
- reset($query_params);
- foreach($query_params as $k => $v) {
+ foreach($query_params as $k => $v) {
$postArray[] = urlencode($k) . '=' . urlencode($v);
}
@@ -338,8 +336,7 @@ function sendCommand($command) {
$this->request = $command;
$cmd = $command . "\r\n";
if (is_array($this->requestHeaders)) {
- reset($this->requestHeaders);
-
+
foreach($this->requestHeaders as $k => $v) {
$cmd .= $k . ': ' . $v . "\r\n";
}

0 comments on commit 3682d13

Please sign in to comment.