Skip to content

Commit

Permalink
No need to go through __get() to access these variables
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jan 30, 2014
1 parent e94536f commit 687249f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions framework/Stream/lib/Horde/Stream.php
Expand Up @@ -169,7 +169,7 @@ public function length($utf8 = false)
{
$pos = $this->pos();

if ($utf8 && $this->utf8_char) {
if ($utf8 && $this->_utf8_char) {
$this->rewind();
$len = 0;
while ($this->getChar() !== false) {
Expand Down Expand Up @@ -366,7 +366,7 @@ public function substring($start = 0, $length = null, $char = false)
* algorithm below. Also, if doing a negative length, deal with that
* below also. */
if ($char &&
$this->utf8_char &&
$this->_utf8_char &&
!$to_end &&
($length >= 0) &&
($length < ($this->length() - $this->pos()))) {
Expand Down Expand Up @@ -438,7 +438,7 @@ public function getEOL()
public function getChar()
{
$char = fgetc($this->_stream);
if (!$this->utf8_char) {
if (!$this->_utf8_char) {
return $char;
}

Expand Down Expand Up @@ -518,7 +518,7 @@ public function seek($offset = 0, $curr = true, $char = false)
}
}

if ($char && $this->utf8_char) {
if ($char && $this->_utf8_char) {
if ($offset > 0) {
if (!$curr) {
$this->rewind();
Expand Down
8 changes: 4 additions & 4 deletions framework/Stream/lib/Horde/Stream/String.php
Expand Up @@ -100,7 +100,7 @@ public function add($data, $reset = false)
*/
public function length($utf8 = false)
{
return ($utf8 && $this->utf8_char)
return ($utf8 && $this->_utf8_char)
? Horde_String::length($this->_str)
: strlen($this->_str);
}
Expand All @@ -109,7 +109,7 @@ public function length($utf8 = false)
*/
public function peek($length = 1)
{
return $this->utf8_char
return $this->_utf8_char
? Horde_String::substr($this->_str, $this->_posUtf8(), $length)
: substr($this->_str, $this->_ptr, $length);
}
Expand All @@ -125,7 +125,7 @@ public function search($char, $reverse = false, $reset = true)

$pos = $this->pos();

if ($this->utf8_char) {
if ($this->_utf8_char) {
$found_pos = $reverse
? Horde_String::rpos($this->_str, $char, $this->length(true) - $this->_posUtf8())
: Horde_String::pos($this->_str, $char, $this->_posUtf8());
Expand Down Expand Up @@ -269,7 +269,7 @@ public function end($offset = 0)
{
$this->_ptr = $this->length();
if ($offset) {
$this->seek($offset, true, $this->utf8_char);
$this->seek($offset, true, $this->_utf8_char);
}

return true;
Expand Down

0 comments on commit 687249f

Please sign in to comment.