Skip to content

Commit

Permalink
Merge pull request zendframework#5550 from samsonasik/add/braces
Browse files Browse the repository at this point in the history
added missing braces {} on foreach and if
  • Loading branch information
Maks3w committed Jan 2, 2014
2 parents db072e7 + 7f7da93 commit 0046aaa
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions library/Zend/Http/Cookies.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,11 @@ public function getMatchingCookies($uri, $matchSessionCookies = true,

// Next, run Cookie->match on all cookies to check secure, time and session matching
$ret = array();
foreach ($cookies as $cookie)
if ($cookie->match($uri, $matchSessionCookies, $now))
foreach ($cookies as $cookie) {
if ($cookie->match($uri, $matchSessionCookies, $now)) {
$ret[] = $cookie;

}
}
// Now, use self::_flattenCookiesArray again - only to convert to the return format ;)
$ret = $this->_flattenCookiesArray($ret, $retAs);

Expand Down Expand Up @@ -218,7 +219,9 @@ public function getCookie($uri, $cookieName, $retAs = self::COOKIE_OBJECT)
// Get correct cookie path
$path = $uri->getPath();
$path = substr($path, 0, strrpos($path, '/'));
if (! $path) $path = '/';
if (! $path) {
$path = '/';
}

if (isset($this->cookies[$uri->getHost()][$path][$cookieName])) {
$cookie = $this->cookies[$uri->getHost()][$path][$cookieName];
Expand Down

0 comments on commit 0046aaa

Please sign in to comment.