TypeRocket / core

TypeRocket core source files where all the magic lives.
https://typerocket.com
36 stars 21 forks source link

Redirect->toUrl improperly convert & to html entity #32

Closed nebulousGirl closed 5 years ago

nebulousGirl commented 5 years ago

The use of esc_url in the toUrl method of the Redirect class breaks redirects with query strings by converting & to #038;:

public function toUrl( $url ) {
        $this->url = esc_url($url);
        return $this;
}

esc_url shouldn't be used here since it is meant to be used for outputting URLs in the DOM. esc_url_raw would be a better fit.