Permalink
Browse files

fixed Bug #2579: warning at stream_open()

some CS and whitespace fixes


git-svn-id: http://svn.php.net/repository/pear/packages/Stream_Var/trunk@171718 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 621241f commit d0c30be062cbee0fefc8782b9437b6a891ecba5d Stephan Schmidt committed Oct 31, 2004
Showing with 6 additions and 5 deletions.
  1. +6 −5 Var.php
View
11 Var.php
@@ -143,8 +143,9 @@ function stream_open($path, $mode, $options, &$opened_path)
break;
}
- if (!$status)
+ if (!$status) {
return false;
+ }
if (!is_scalar($this->_pointer)) {
return false;
@@ -159,7 +160,7 @@ function stream_open($path, $mode, $options, &$opened_path)
$this->stream_seek(0, SEEK_END);
}
- if ($mode{1} == '+') {
+ if (strlen($mode) > 1 && $mode{1} == '+') {
$this->_mode = $this->_mode | STREAM_VAR_READABLE | STREAM_VAR_WRITEABLE;
}
@@ -195,8 +196,8 @@ function stream_tell()
*/
function stream_close()
{
- $this->_pos = 0;
- $this->_open = false;
+ $this->_pos = 0;
+ $this->_open = false;
}
/**
@@ -306,7 +307,7 @@ function stream_flush()
function stream_stat()
{
$stat = array(
- "size" => strlen($this->_pointer)
+ 'size' => strlen($this->_pointer)
);
return $stat;
}

0 comments on commit d0c30be

Please sign in to comment.