From: Operating system: Linux Debian wheezy/sid PHP version: 5.4.0 Package: *General Issues Bug Type: Bug Bug description:Problem in htmlentities()
Description: ------------ The first call of htmlentities works OK, but, the next call always return a empty string. When I print_r($res), all values are printed OK Test script: --------------- mysql_connect($db_host,$db_user,$db_pass); mysql_select_db($database); $sql = "select noticia_id,noticia_datacad,noticia_assunto,noticia_titulo from tab_noticia order by noticia_data desc,categoria_id desc,noticia_id desc limit 15;"; $qry = mysql_query($sql); $res = mysql_fetch_row($qry); while ($res) { $title = htmlentities($res[3]); $subject = htmlentities($res[2]); $data = $res[1]; echo "\t\t\t\t\t<item>\r\n"; echo "\t\t\t\t\t\t<title>".$titulo."</title>\r\n"; echo "\t\t\t\t\t\t<description>".$assunto."</description>\r\n"; echo "\t\t\t\t\t\t<lastBuildDate>".$data."</lastBuildDate>\r\n"; echo "\t\t\t\t\t\t<link>http://www.the.site/news.php?id=".$id."</link>\r\n"; echo "\t\t\t\t\t</item>\r\n"; $res = mysql_fetch_row($qry); } // end while mysql_close(); -- Edit bug report at https://bugs.php.net/bug.php?id=61801&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61801&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61801&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61801&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61801&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61801&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61801&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61801&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61801&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61801&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61801&r=support Expected behavior: https://bugs.php.net/fix.php?id=61801&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61801&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61801&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61801&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61801&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=61801&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61801&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61801&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61801&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61801&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61801&r=mysqlcfg