Customize: Make sure that preview and return URLs are URLs.

git-svn-id: https://develop.svn.wordpress.org/trunk@37527 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2016-05-23 09:32:47 +00:00
parent 8fceb0deda
commit 4587dee582

View File

@ -1631,6 +1631,7 @@ final class WP_Customize_Manager {
* @param string $preview_url URL to be previewed.
*/
public function set_preview_url( $preview_url ) {
$preview_url = esc_url_raw( $preview_url );
$this->preview_url = wp_validate_redirect( $preview_url, home_url( '/' ) );
}
@ -1662,6 +1663,7 @@ final class WP_Customize_Manager {
* @param string $return_url URL for return link.
*/
public function set_return_url( $return_url ) {
$return_url = esc_url_raw( $return_url );
$return_url = remove_query_arg( wp_removable_query_args(), $return_url );
$return_url = wp_validate_redirect( $return_url );
$this->return_url = $return_url;