[wp-trac] [WordPress Trac] #7483: redirect_canonical not send type_of_url to user_trailingslashit

WordPress Trac wp-trac at lists.automattic.com
Fri Aug 8 13:17:27 GMT 2008


#7483: redirect_canonical not send type_of_url to user_trailingslashit
---------------------+------------------------------------------------------
 Reporter:  xorax    |       Owner:  anonymous             
     Type:  defect   |      Status:  new                   
 Priority:  high     |   Milestone:  2.7                   
Component:  General  |     Version:                        
 Severity:  minor    |    Keywords:  canonical url redirect
---------------------+------------------------------------------------------
 the function redirect_canonical not send correct type_of_url to
 user_trailingslashit when path is not home.

 an accolade missing and it's in accordance with the indentation.


 {{{
 canonical.php :
 ***************
 *** 165,175 ****
                 } else {
                         foreach ( array('single', 'category', 'page',
 'day', 'month', 'year') as $type ) {
                                 $func = 'is_' . $type;
 !                               if ( call_user_func($func) )
                                         $user_ts_type = $type;
                                         break;
                                 }
                         }
                 $redirect['path'] =
 user_trailingslashit($redirect['path'], $user_ts_type);
         } elseif ( is_home() ) {
                 $redirect['path'] = trailingslashit($redirect['path']);
 --- 165,176 ----
                 } else {
                         foreach ( array('single', 'category', 'page',
 'day', 'month', 'year') as $type ) {
                                 $func = 'is_' . $type;
 !                               if ( call_user_func($func) ) {
                                         $user_ts_type = $type;
                                         break;
                                 }
                         }
 +               }
                 $redirect['path'] =
 user_trailingslashit($redirect['path'], $user_ts_type);
         } elseif ( is_home() ) {
                 $redirect['path'] = trailingslashit($redirect['path']);

-- 
Ticket URL: <http://trac.wordpress.org/ticket/7483>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list