pein0119 / phpquery

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

Appending "<" characters make it bug #59

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. <php>$myDIV->append('12<=14');</php>
2.
3.

What is the expected output? What do you see instead?
I expect to get that <html><div>12<=14</div></html>. Instead of that I get
<html><div>12</div></html>.

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

Please provide any additional information below.

Original issue reported on code.google.com by nicolas....@gmail.com on 15 Oct 2008 at 6:25

GoogleCodeExporter commented 8 years ago
< is special character in html and should be encoded properly as < when not used
for tags. Even in <pre> tag. Textarea may be an exception.

Original comment by tobiasz....@gmail.com on 16 Oct 2008 at 12:12

GoogleCodeExporter commented 8 years ago
Hum OK, but that's working under jQuery :
<js>$myJqueryElement.append('test<=23');</js>

Original comment by nicolas....@gmail.com on 16 Oct 2008 at 8:49

GoogleCodeExporter commented 8 years ago
Maybe browser's parser hadles better such situations, but it's seems php libxml 
dont.
Anyway it shouldn't be used that way IMHO.

Just use htmlspecialchars() before...

Original comment by tobiasz....@gmail.com on 16 Oct 2008 at 9:01

GoogleCodeExporter commented 8 years ago
OK ^^ ! You're right :).
Should be parse before !

Original comment by nicolas....@gmail.com on 16 Oct 2008 at 9:05