Fix issue 65

git-svn-id: http://php-reader.googlecode.com/svn/trunk@255 51a70ab9-7547-0410-9469-37e369ee0574
This commit is contained in:
svollbehr
2012-01-21 19:46:18 +00:00
parent 3354d7c0cf
commit 7ad54f1699
4 changed files with 13 additions and 10 deletions

View File

@@ -65,7 +65,7 @@ final class Zend_Media_Id3_Frame_Comm extends Zend_Media_Id3_LanguageTextFrame
$encoding = $this->_reader->readUInt8(); $encoding = $this->_reader->readUInt8();
$this->_language = strtolower($this->_reader->read(3)); $this->_language = strtolower($this->_reader->read(3));
if ($this->_language == 'xxx') { if ($this->_language == 'xxx' || trim($this->_language, "\0") == '') {
$this->_language = 'und'; $this->_language = 'und';
} }

View File

@@ -96,7 +96,7 @@ final class Zend_Media_Id3_Frame_SYLT extends Zend_Media_Id3_Frame
$encoding = $this->_reader->readUInt8(); $encoding = $this->_reader->readUInt8();
$this->_language = strtolower($this->_reader->read(3)); $this->_language = strtolower($this->_reader->read(3));
if ($this->_language == 'xxx') { if ($this->_language == 'xxx' || trim($this->_language, "\0") == '') {
$this->_language = 'und'; $this->_language = 'und';
} }
$this->_format = $this->_reader->readUInt8(); $this->_format = $this->_reader->readUInt8();
@@ -110,8 +110,10 @@ final class Zend_Media_Id3_Frame_SYLT extends Zend_Media_Id3_Frame
list($this->_description) = list($this->_description) =
$this->_explodeString16 $this->_explodeString16
($this->_reader->read($this->_reader->getSize()), 2); ($this->_reader->read($this->_reader->getSize()), 2);
if ($this->_reader->getSize() >= $offset + strlen($this->_description) + 2) {
$this->_reader->setOffset $this->_reader->setOffset
($offset + strlen($this->_description) + 2); ($offset + strlen($this->_description) + 2);
}
break; break;
case self::UTF8: case self::UTF8:
// break intentionally omitted // break intentionally omitted
@@ -119,12 +121,13 @@ final class Zend_Media_Id3_Frame_SYLT extends Zend_Media_Id3_Frame
list($this->_description) = list($this->_description) =
$this->_explodeString8 $this->_explodeString8
($this->_reader->read($this->_reader->getSize()), 2); ($this->_reader->read($this->_reader->getSize()), 2);
if ($this->_reader->getSize() >= $offset + strlen($this->_description) + 1) {
$this->_reader->setOffset $this->_reader->setOffset
($offset + strlen($this->_description) + 1); ($offset + strlen($this->_description) + 1);
}
break; break;
} }
$this->_description = $this->_description = $this->_convertString($this->_description, $encoding);
$this->_convertString($this->_description, $encoding);
while ($this->_reader->available()) { while ($this->_reader->available()) {
$offset = $this->_reader->getOffset(); $offset = $this->_reader->getOffset();

View File

@@ -64,7 +64,7 @@ final class Zend_Media_Id3_Frame_Uslt extends Zend_Media_Id3_LanguageTextFrame
$encoding = $this->_reader->readUInt8(); $encoding = $this->_reader->readUInt8();
$this->_language = strtolower($this->_reader->read(3)); $this->_language = strtolower($this->_reader->read(3));
if ($this->_language == 'xxx') { if ($this->_language == 'xxx' || trim($this->_language, "\0") == '') {
$this->_language = 'und'; $this->_language = 'und';
} }

View File

@@ -81,7 +81,7 @@ abstract class Zend_Media_Id3_LanguageTextFrame extends Zend_Media_Id3_Frame
$encoding = $this->_reader->readUInt8(); $encoding = $this->_reader->readUInt8();
$this->_language = strtolower($this->_reader->read(3)); $this->_language = strtolower($this->_reader->read(3));
if ($this->_language == 'xxx') { if ($this->_language == 'xxx' || trim($this->_language, "\0") == '') {
$this->_language = 'und'; $this->_language = 'und';
} }