aramds / php-reader

code.google.com/p/php-reader
0 stars 0 forks source link

notice issued when string is empty #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
  public static function fromString16($value)
  {
      if ($value[0] == 0xfe && $value[1] = 0xff)
        return self::fromString16BE(substr($value, 2));
      else
        return self::fromString16LE(substr($value, 2));
  }

This chokes if $value is an empty string.  I made the following change to get 
rid of the notices:

  public static function fromString16($value)
  {
    if(strlen($value) == 0)
        return '';

      if ($value[0] == 0xfe && $value[1] = 0xff)
        return self::fromString16BE(substr($value, 2));
      else
        return self::fromString16LE(substr($value, 2));
  }

This occurred with the following two lines of code:
require_once("ID3v2.php");
$id3 = new ID3v2('/path/to/file.mp3');

Original issue reported on code.google.com by rgig...@gmail.com on 17 Jul 2008 at 6:06

GoogleCodeExporter commented 9 years ago
This is fixed in my ID3v2 improvements which can be found here: 
http://code.google.com/p/php-
reader/issues/detail?id=11

Original comment by but...@gmail.com on 29 Jul 2008 at 12:50

GoogleCodeExporter commented 9 years ago

Original comment by svollbehr on 29 Jul 2008 at 7:04

GoogleCodeExporter commented 9 years ago
Issue solved, thanks for reporting

Original comment by svollbehr on 30 Jul 2008 at 2:59

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by svollbehr on 20 Feb 2009 at 9:21