htmlentities returning nothing in demo

Think you found a bug in getID3()? Post here with details.
Post Reply
fluxus
User
Posts: 3
Joined: Sun Oct 05, 2014 3:51 pm
Are you a spambot?: no

htmlentities returning nothing in demo

Post by fluxus » Sun Oct 05, 2014 4:25 pm

In the demo script demo.basic.php, it was working fine under PHP 5.3, but since I upgraded to PHP 5.5.15 the last statement just gives me a blank page:

echo '<pre>'. htmlentities(print_r($ThisFileInfo, true)). '</pre>';

Unless I change it to this:

echo '<pre>'. htmlentities(print_r($ThisFileInfo, true), ENT_COMPAT, 'iso-8859-1'). '</pre>';

And then it works fine.

getID3 version: 1.9.8-20140511
OS: Win7 x86
Chrome

James Heinrich
getID3() v1 developer
Posts: 1432
Joined: Fri May 04, 2001 4:00 pm
Are you a spambot?: no
Location: Northern Ontario, Canada
Contact:

Re: htmlentities returning nothing in demo

Post by James Heinrich » Sun Oct 05, 2014 5:30 pm

The default character set for htmlentities changed from ISO-8859-1 to UTF-8 in PHP v5.4

getID3 by default should output UTF-8, unless you override $getid3->encoding.

I did a quick test with demo.basic.php on PHP v5.4.7 and htmlentities(print_r($ThisFileInfo, true)) and it worked fine.

Does this problem occur for you on only one particular sample file or all files?
Can you show the full code snippet you used to call getID3 and get blank output?

fluxus
User
Posts: 3
Joined: Sun Oct 05, 2014 3:51 pm
Are you a spambot?: no

Re: htmlentities returning nothing in demo

Post by fluxus » Sun Oct 05, 2014 7:53 pm

I tested another random file and the same thing happens.

Code: Select all

$filename = 'Grind.mp3';
require_once('../getid3.php');
$getID3 = new getID3;
$ThisFileInfo = $getID3->analyze($filename);
getid3_lib::CopyTagsToComments($ThisFileInfo);
echo '<pre>'. htmlentities(print_r($ThisFileInfo, true)).'</pre>';
//echo '<pre>'. htmlentities(print_r($ThisFileInfo, true), ENT_COMPAT, 'iso-8859-1'). '</pre>';

Post Reply