Skip to content

Commit

Permalink
Existence check.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrubinsk committed Dec 31, 2014
1 parent 7459015 commit ca69c9e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions framework/Compress/lib/Horde/Compress/Tnef/Rtf.php
Expand Up @@ -329,7 +329,11 @@ protected function _rtf2text($text)
case '{':
// New subgroup starts, add new stack element and write the data
// from previous stack element to it.
array_push($stack, $stack[$j++]);
if (!empty($stack[$j])) {
array_push($stack, $stack[$j++]);
} else {
$j++;
}
break;
case '}':
array_pop($stack);
Expand All @@ -343,7 +347,7 @@ protected function _rtf2text($text)
break;
default:
// Add other data to the output stream if required.
if ($this->_rtfIsPlain($stack[$j])) {
if (!empty($stack[$j]) && $this->_rtfIsPlain($stack[$j])) {
$document .= $c;
}
break;
Expand Down

0 comments on commit ca69c9e

Please sign in to comment.