Edit report at https://bugs.php.net/bug.php?id=61152&edit=1
ID: 61152 Updated by: ras...@php.net Reported by: momchil dot bozhinov at hp dot com Summary: parse_ini_string problem with html input -Status: Open +Status: Not a bug Type: Bug Package: Scripting Engine problem Operating System: Windows PHP Version: 5.4.0RC8 Block user comment: N Private report: N New Comment: No, the ini parser is a parser much like PHP uses a parser to parse the language. Parsers generate syntax errors when the text they are trying to parse doesn't match the defined syntax. This is expected behaviour. Previous Comments: ------------------------------------------------------------------------ [2012-02-21 07:39:34] momchil dot bozhinov at hp dot com Description: ------------ I get a warning while trying to parse ini input. problem is that the input comes from a file stored on the web and sometimes it comes back as HTML (proxy issue). The warning is reported as "syntax error", which I understand as something that got out of the variable and was executed. Test script: --------------- <?php $result = "<HTML><HEAD> <TITLE>Network Error</TITLE> </HEAD> <BODY> <FONT face=\"Helvetica\"> <big><strong></strong></big><BR> </FONT> <blockquote> <TABLE border=0 cellPadding=1 width=\"80%\"> <TR><TD> <FONT face=\"Helvetica\"> <big>Network Error (dns_unresolved_hostname)</big> <BR> <BR> </FONT> </TD></TR> <TR><TD> </FONT> </TD></TR> <TR><TD> </BODY></HTML>"; parse_ini_string($result); // ===== 5.4 RC8 // Warning: syntax error, unexpected '=' in Unknown on line 9 // in C:\Users\***\Desktop\SFK\AutoPHP\bug.php on line 25 // ===== 5.3.10 // Warning: syntax error, unexpected '=' in Unknown on line 9 //in C:\Users\bozhinov\Desktop\SFK\AutoPHP\php53\bug.php on line 25 ?> ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=61152&edit=1