[wp-hackers] wp_enqueue_script() and URLs with 2+ parameters

Mike Schinkel mikeschinkel at newclarity.net
Fri Feb 27 20:39:23 GMT 2009


"Matt Martz" <mdmartz at sivel.net> wrote:
> So I'm not sure I understand what the problem with having 
> the & replaced with &#038; is.

The problem is that &#038; is not a valid parameter separator for a URL, in PHP or the RFC that defines URLs.  Here is a test file that demonstrates:

<?php
   header('Content-Type:text/plain');
   echo "\nFoo=" . $_GET['foo'];
   echo "\nBar=" . $_GET['bar'];
?>

You can test it to see the results currently here:

   http://mikeschinkel.com/url-encoding-issue.php?foo=1&#038;bar=2
   http://mikeschinkel.com/url-encoding-issue.php?foo=1&bar=2

The following example provides two files (one HTML, one PHP that returns Javascript) illustrates the problem more closely for my use-case:

   http://mikeschinkel.pastebin.com/f24b7cc23

"Glenn Ansley" <glenn at glennansley.com> wrote:
> I think this is a fairly limited use and may not be necessary 
> for core. 

While I've learned that discussions of something being in core are somewhat, ahem,  volatile I would argue once that this is a problem even if an uncommon case because it doesn't allow valid URLs and this goes against the RFC standard for URLs. But that's all I'll say on this subject that lest I be accused of causing trouble on the list again.

-Mike Schinkel
http://mikeschinkel.com/



More information about the wp-hackers mailing list