TargetUrl removes * when redirecting

3 months ago | empire29 (Member) | |

I am using Wordpress 2.6, Redirection 2.0.4 using the WordPress Module.

I an creating redirects in the form:
Method: 301
URL: /redirect/100
Target URL: http://www.externalsite.com/some/crazy*query/string/

When i enter http://www.myhdtvdeals.com/redirect/100 I am redirect to:
http://www.externalsite.com/some/crazyquery/string/ <- Note: The * or asterisk is removed from the TargetURL.

When i go back to the Redirection Admin interface and look at the TargetURL is correctly reads: http://www.externalsite.com/some/crazy*query/string/

Any ideas how I can keep the * in my TargetURL when the redirection is performed?

I tried to trace back through the code to find where the * is stripped out but I couldn't find it...

Thanks in advance! Otherwise a SUPERB plugin!

Read responses...

Responses

  1. John:

    Posted 3 months ago by Key Master

    Ok, I get what you mean now. After looking into this it seems that Redirection is not stripping anything. Instead it is the WordPress function wp_sanitize_redirect in wp-includes/pluggable.php that is removing the *. You can fix this by changing this line:

    $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/:%]|i', '', $location);

    Into:

    $location = preg_replace('|[^a-z0-9-~+_.?#=&;,/\*:%]|i', '', $location);

Reply

You must log in to post.

Home | Software | Terms & Conditions | Sitemap | John Godley © 2008