Ticket #7537: trailing-spaces-canonical.diff
File trailing-spaces-canonical.diff, 1.6 KB (added by , 17 years ago) |
---|
-
wp-includes/query.php
524 524 $qv['w'] = absint($qv['w']); 525 525 $qv['m'] = absint($qv['m']); 526 526 $qv['cat'] = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers 527 $qv['pagename'] = trim( $qv['pagename'] ); 528 $qv['name'] = trim( $qv['name'] ); 527 529 if ( '' !== $qv['hour'] ) $qv['hour'] = absint($qv['hour']); 528 530 if ( '' !== $qv['minute'] ) $qv['minute'] = absint($qv['minute']); 529 531 if ( '' !== $qv['second'] ) $qv['second'] = absint($qv['second']); -
wp-includes/canonical.php
153 153 // trailing /index.php/ 154 154 $redirect['path'] = preg_replace('|/index.php/$|', '/', $redirect['path']); 155 155 156 // Remove trailing spaces from the path 157 $redirect['path'] = preg_replace( '#(%20| )+$#', '', $redirect['path'] ); 158 159 // Remove trailing slashes from certain terminating query string args 160 $redirect['query'] = preg_replace( '#((p|page_id|cat|tag)=[^&]*?)(%20| )+$#', '$1', $redirect['query'] ); 161 162 // Clean up empty query strings 163 $redirect['query'] = preg_replace( '#&?(p|page_id|cat|tag)=?$#', '', $redirect['query'] ); 164 156 165 // strip /index.php/ when we're not using PATHINFO permalinks 157 166 if ( !$wp_rewrite->using_index_permalinks() ) 158 167 $redirect['path'] = str_replace('/index.php/', '/', $redirect['path']);