"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "public_html/lists/admin/plugins/Common/StringStream.php" between
phplist-3.4.9.tgz and phplist-3.5.0.tgz

About: phpList is a one-way email announcement delivery system for newsletters, publicity lists, notifications, and many other uses (requires PHP and MySQL).

StringStream.php  (phplist-3.4.9.tgz):StringStream.php  (phplist-3.5.0.tgz)
skipping to change at line 34 skipping to change at line 34
const MODE_WRITE = 2; const MODE_WRITE = 2;
private $_currentstring; private $_currentstring;
private $_mode; private $_mode;
private $_pos; private $_pos;
private static $references = array(); private static $references = array();
public static function stringId(&$variable) public static function stringId(&$variable)
{ {
$id = count(self::$references); $id = uniqid();
self::$references[$id] = &$variable; self::$references[$id] = &$variable;
return $id; return $id;
} }
public static function fopen(&$variable, $mode = 'r') public static function fopen(&$variable, $mode = 'r')
{ {
$id = self::stringId($variable); $id = self::stringId($variable);
$fh = fopen("string://$id", $mode); $fh = fopen("string://$id", $mode);
skipping to change at line 82 skipping to change at line 82
{ {
return false; return false;
} }
public function stream_read($count) public function stream_read($count)
{ {
if ($this->_mode != self::MODE_READ) { if ($this->_mode != self::MODE_READ) {
return false; return false;
} }
if ($this->stream_eof()) {
return false;
}
$result = substr($this->_currentstring, $this->_pos, $count); $result = substr($this->_currentstring, $this->_pos, $count);
$this->_pos += $count; $this->_pos += strlen($result);
return $result; return $result;
} }
public function stream_write($data) public function stream_write($data)
{ {
if ($this->_mode != self::MODE_WRITE) { if ($this->_mode != self::MODE_WRITE) {
return false; return false;
} }
 End of changes. 3 change blocks. 
6 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)