#5391 closed defect (bug) (invalid)
Anchor tag, href attribute needs entity & convert to & for proper URL
| Reported by: | johnathan10102 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | General | Version: | 2.3.1 |
| Severity: | normal | Keywords: | URL entity amperstand |
| Cc: | Focuses: |
Description
When a comment/post is passed through the HTML/XHTML filter, kses.php, the URL of an anchor tag, href attribute needs the HTML entity for the ampersand needs to be converted to character form.
Example, A user posts a comment to a blog post.
Input : Hey check my gallery too! <a href="http://hissite.com/index.php?page=art&work=23">Gallery!</a>
Output : Hey check my gallery too! <a href="http://hissite.com/index.php?page=art&work=23">Gallery!</a>
Now the url to his gallery is broken :/. Its no longer $_GETwork rather $_GETamp;work.
I have created a patch for this though.
--- kses.php.old 2007-11-26 18:32:44.000000000 -0500
+++ kses.php 2007-11-26 18:36:57.000000000 -0500
@@ -546,7 +546,8 @@
# fooled by a string like "javascript:javascript:alert(57)".
###############################################################################
{
- $string = wp_kses_no_null($string);
+ $string = wp_kses_no_null($string);
+ $string = str_replace("&", "&", $string);
$string = preg_replace('/\xad+/', , $string); # deals with Opera "feature"
$string2 = $string.'a';
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)