Ticket #2857 (closed defect (bug): fixed)

Opened 3 years ago

Last modified 3 years ago

WP_Scripts->_print_scripts and add_query_arg generate invalid links

Reported by: Nazgul Assigned to: anonymous
Priority: normal Milestone: 2.1
Component: Administration Version: 2.1
Severity: normal Keywords: query arguments bg|has-patch
Cc:

Description

When a link with more than 1 parameter is generated by WP_Scripts, it's generated as http://domain.tld/somescript.js?a=1&b=2, which should be http://domain.tld/somescript.js?a=1&b=2, according to the XHTML guidelines.

Same applies to the add_query_arg function.

Attachments

2857.diff (1.1 kB) - added by Nazgul on 06/24/06 14:15:11.
2857b.diff (1.2 kB) - added by Nazgul on 06/24/06 22:49:33.

Change History

06/24/06 14:15:11 changed by Nazgul

  • attachment 2857.diff added.

06/24/06 14:16:38 changed by Nazgul

  • keywords changed from query arguments to query arguments bg|has-patch.

Patch which uses & instead of & to concatenate uploaded.

06/24/06 20:49:38 changed by markjaquith

& should not be used within add_query_arg() function. Rather, the thing that is calling it should run wp_specialchars() on the output. We need non-encoded to be the default.

The Script Loader fix looks good, though.

06/24/06 22:49:33 changed by Nazgul

  • attachment 2857b.diff added.

06/24/06 22:50:52 changed by Nazgul

Ok. New Patch.

Instead of changing add_query_arg I changed the calling function in which I noticed the behaviour (wp_nonce_url), as you suggested.

The Script Loader fix is also included, but hasn't changed.

06/25/06 09:02:20 changed by markjaquith

Looks good to me. The only potential concern is if wp_nonce_url is fed to a redirection script. e.g. wp_redirect(wp_nonce_url($url, $action));

Attn: Owen and Ryan, Is this a plausible scenario?

06/27/06 06:42:39 changed by ryan

  • version set to 2.1.

[3930] fixes script-loader.

06/27/06 06:47:41 changed by ryan

wp_nonce_url() is being used on URLs that are already converted, so maybe we should go ahead and specialchars within wp_nonce_url().

07/05/06 09:52:20 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [3973]) wp_specialchars() within wp_nonce_url(). Props Nazgul. fixes #2857

07/05/06 09:55:25 changed by ryan

(In [3974]) wp_specialchars() within wp_nonce_url(). Props Nazgul. fixes #2857