Ticket #7483 (closed defect: fixed)

Opened 4 months ago

Last modified 4 months ago

redirect_canonical not send type_of_url to user_trailingslashit

Reported by: xorax Assigned to: markjaquith
Priority: high Milestone: 2.6.1
Component: General Version: 2.7
Severity: minor Keywords: has-patch canonical url redirect
Cc:

Description

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']);

Attachments

7483.diff (0.6 kB) - added by DD32 on 08/08/08 13:25:32.
Reporters code in .diff format.

Change History

08/08/08 13:25:32 changed by DD32

  • attachment 7483.diff added.

Reporters code in .diff format.

08/08/08 13:26:08 changed by DD32

  • keywords changed from canonical url redirect to has-patch canonical url redirect.
  • version set to 2.7.

08/08/08 17:34:13 changed by ryan

  • owner changed from anonymous to markjaquith.

08/08/08 17:43:45 changed by markjaquith

  • status changed from new to closed.
  • resolution set to fixed.

(In [8593]) Fix braces so user_trailingslashit gets the correct information passed in canonical redirect code. props xorax. fixes #7483 for trunk

08/08/08 17:46:38 changed by markjaquith

  • status changed from closed to reopened.
  • resolution deleted.
  • milestone changed from 2.7 to 2.6.1.

Reopening for 2.6.1

08/08/08 17:46:49 changed by markjaquith

  • status changed from reopened to closed.
  • resolution set to fixed.

(In [8594]) Fix braces so user_trailingslashit gets the correct information passed in canonical redirect code. props xorax. fixes #7483 for 2.6.1