Ticket #32692: 32692.2.patch
File 32692.2.patch, 1.5 KB (added by , 9 years ago) |
---|
-
wp-admin/customize.php
21 21 $url = wp_validate_redirect( $url, home_url( '/' ) ); 22 22 if ( $return ) { 23 23 $return = wp_unslash( $return ); 24 $return = wp_admin_canonical_url( $return, false ); 24 25 $return = wp_validate_redirect( $return ); 25 26 } 26 27 if ( ! $return ) { -
wp-admin/includes/misc.php
864 864 * 865 865 * @since 4.2.0 866 866 */ 867 function wp_admin_canonical_url( ) {867 function wp_admin_canonical_url($url = '', $print = true) { 868 868 $removable_query_args = array( 869 869 'message', 'settings-updated', 'saved', 870 870 'update', 'updated', 'activated', … … 888 888 } 889 889 890 890 // Ensure we're using an absolute URL. 891 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 891 if( empty( $url ) ) { 892 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ); 893 } else { 894 $current_url = $url; 895 } 892 896 $filtered_url = remove_query_arg( $removable_query_args, $current_url ); 897 if( true === $print ) { 893 898 ?> 894 899 <link id="wp-admin-canonical" rel="canonical" href="<?php echo esc_url( $filtered_url ); ?>" /> 895 900 <script> … … 898 903 } 899 904 </script> 900 905 <?php 906 } else { 907 return esc_url( $filtered_url ); 908 } 901 909 }