Changeset 34643
- Timestamp:
- 09/27/2015 10:10:08 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/canonical.php
r34561 r34643 40 40 */ 41 41 function redirect_canonical( $requested_url = null, $do_redirect = true ) { 42 global $wp_rewrite, $is_IIS, $wp_query, $wpdb ;42 global $wp_rewrite, $is_IIS, $wp_query, $wpdb, $wp; 43 43 44 44 if ( isset( $_SERVER['REQUEST_METHOD'] ) && ! in_array( strtoupper( $_SERVER['REQUEST_METHOD'] ), array( 'GET', 'HEAD' ) ) ) { … … 158 158 } elseif ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() ) { 159 159 // rewriting of old ?p=X, ?m=2004, ?m=200401, ?m=20040101 160 if ( is_attachment() && ! $redirect_url ) { 160 if ( is_attachment() && 161 ! array_diff( array_keys( $wp->query_vars ), array( 'attachment', 'attachment_id' ) ) && 162 ! $redirect_url ) { 161 163 if ( ! empty( $_GET['attachment_id'] ) ) { 162 164 $redirect_url = get_attachment_link( get_query_var( 'attachment_id' ) );
Note: See TracChangeset
for help on using the changeset viewer.