blueprintmrk / isemail

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

Strip C-Slashes for XML #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Test #227 fails on my local installation with PHP 5.

Original issue reported on code.google.com by danielma...@googlemail.com on 14 Jun 2010 at 9:36

GoogleCodeExporter commented 9 years ago

Original comment by dominic....@gmail.com on 15 Jun 2010 at 8:00

GoogleCodeExporter commented 9 years ago
Hi Daniel,

Are you sure you're including the NUL (char(0)) character in what you're 
testing? It's hard to include this in the XML document. The point of the test 
is to ensure that a NUL character invalidates the address even if it is escaped.

This page is dynamically generated: 
http://www.dominicsayers.com/isemail/results.php and my hosting provider is 
running PHP 5.

D.

Original comment by dominic....@gmail.com on 13 Aug 2010 at 1:09

GoogleCodeExporter commented 9 years ago
Hello Dominic,

sorry, I didn't get notified about this comments. I dunno why.

Well, I thought it myself that would meant NUL and not just "\0". Of course, it 
couldn't work with the XML. Well, I downloaded your package, converted the XML 
into the PHP testcase and then ran the testcase. Test #227 failed. The reason 
was that the XML was parsed as-it-is and so there was "\0" instead of NUL. The 
same with my Java-Testcases (which read and parse the XML on-the-fly, yay ^^).

Well, I'll try to figure out if this "\0" -> NUL replacement could be done 
automatically, so that the XML can be converted to a "correct" testcase #227 
with a NUL instead of "\0".

(PS: I tried it with PHP5 and XAMPP on Windows system)

Regards
Daniel Marschall

Original comment by danielma...@googlemail.com on 8 Sep 2010 at 5:35

GoogleCodeExporter commented 9 years ago

Original comment by dominic....@gmail.com on 8 Sep 2010 at 8:36

GoogleCodeExporter commented 9 years ago
I don't tink that this issue is "Invalid". Your XML to PHP-testcase converted 
just don't work. That IS a bug (also if it is not a bug in is_email() function 
itself).

Original comment by danielma...@googlemail.com on 8 Sep 2010 at 6:11

GoogleCodeExporter commented 9 years ago
Here is the solution of the parsing of the XML file in PHP correctly:

stripcslashes('\0') == "\0"

(I have not tested if this issue has been resolved for PHP-branch until version 
2.1)

Now, I have to find the same solution for Java. My Java-branch interpretes '\0' 
still as \0 and not as [NUL].

Original comment by danielma...@googlemail.com on 9 Sep 2010 at 4:29

GoogleCodeExporter commented 9 years ago
Finished.

Java branch now correctly converts NUL-chars. All tests are now 100%. (=> 
"FIXED")

PHP branch did not have that failure in version 2.1. In fact, only "\0" was 
converted to NUL, not any other C-Escapes. (=> "INVALID")

Original comment by danielma...@googlemail.com on 9 Sep 2010 at 9:04