Skip to content

Commit

Permalink
Merge pull request aws#316 from evan-king/master
Browse files Browse the repository at this point in the history
Uses explicit single-flag checks in StreamWrapper::triggerError
  • Loading branch information
jeremeamia committed Jun 26, 2014
2 parents 81d9d2c + bb9f161 commit 8184c0c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/Aws/S3/StreamWrapper.php
Expand Up @@ -723,16 +723,14 @@ protected function openAppendStream(array $params, array &$errors)
*/
protected function triggerError($errors, $flags = null)
{
// Only consider the 2 bits of flags
// Note: 5.5.13 added a new flag, which is why this is needed
$flags &= 3;

if ($flags === STREAM_URL_STAT_QUIET) {
// This is triggered with things like file_exists()
return false;
} elseif ($flags === (STREAM_URL_STAT_QUIET | STREAM_URL_STAT_LINK)) {
if ($flags & STREAM_URL_STAT_QUIET) {
// This is triggered with things like file_exists()

if ($flags & STREAM_URL_STAT_LINK) {
// This is triggered for things like is_link()
return $this->formatUrlStat(false);
}
return false;
}

// This is triggered when doing things like lstat() or stat()
Expand Down

0 comments on commit 8184c0c

Please sign in to comment.