tsuyopon / webpagetest

Automatically exported from code.google.com/p/webpagetest
0 stars 0 forks source link

XML results from runtest.php need to properly escape the contents of elements #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use the web api to run a job and use a picky XML parser on the response
2. Or, try to use the visual comparison tool with an XML parser that is anal 
about &'s in its input

What is the expected output? What do you see instead?

  XML with properly escaped elements, eg, "&" turned into "&"

What version of the product are you using? On what operating system?

  A private instance of 2.3. Problem is still present in trunk (lines 385 and 413 of runtest.php).

  O/S is not relevant, though the simplexml in my PHP interpreter seems to be picky about what it will parse.

Please provide any additional information below.

  In particular, the ampersands within the URLs of the two places that detailCSV elements are produced need to be escaped. Some XML parsers choke on the entire XML document without proper & escapes in them, and all XML parsers should understand how to unescape them.

Example of said choking (unfortunately, I've since deleted the test xml and php 
files). It clearly shows the parse error and the element it barfed on.

[Sun Sep 25 11:28:29 2011] [error] [client 207.162.200.253] PHP Warning:  
simplexml_load_file(): test.xml:11: parser error : EntityRef: expecting ';' in 
/data/wpt.flirble.org/testxml.php on line 3
[Sun Sep 25 11:28:29 2011] [error] [client 207.162.200.253] PHP Warning:  
simplexml_load_file(): 
<detailCSV>http://wpt.flirble.org/csv.php?test=110925_9M_Y&requests=1</detailCSV
 in /data/wpt.flirble.org/testxml.php on line 3
[Sun Sep 25 11:28:29 2011] [error] [client 207.162.200.253] PHP Warning:  
simplexml_load_file():                                                          
          ^ in /data/wpt.flirble.org/testxml.php on line 3

Original issue reported on code.google.com by chr...@flirble.org on 26 Sep 2011 at 12:35

GoogleCodeExporter commented 9 years ago
Thanks for the heads-up.  It is now fixed in the trunk and will be included in 
the 2.4 release (hopefully this week).

Original comment by PatMee...@gmail.com on 26 Sep 2011 at 8:27