public function getStringTableEntry($index) { if ($index >= strlen($this->_stringTable)) { $this->_error = new Horde_Xml_Wbxml_Exception('Invalid offset ' . $index . ' value encountered around position ' . $this->_strpos . '. Broken wbxml?'); return ''; } // copy of method termstr but without modification of this->_strpos $str = '#'; // must start with nonempty string to allow array access $i = 0; $ch = $this->_stringTable[$index++]; if (ord($ch) == 0) { return ''; // don't return '#' } while (ord($ch) != 0) { $str[$i++] = $ch; if ($index >= strlen($this->_stringTable)) { break; } $ch = $this->_stringTable[$index++]; } // print "string table entry: $str\n"; return $str; }