Notice fixes. See #7509 props DD32.

git-svn-id: http://svn.automattic.com/wordpress/trunk@9177 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2008-10-14 21:08:28 +00:00
parent 4e4c26678e
commit a0f339d3bf
3 changed files with 5 additions and 5 deletions

View File

@ -166,6 +166,8 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
$user_home = @parse_url(get_option('home')); $user_home = @parse_url(get_option('home'));
if ( isset($user_home['host']) ) if ( isset($user_home['host']) )
$redirect['host'] = $user_home['host']; $redirect['host'] = $user_home['host'];
if ( !isset($user_home['path']) )
$user_home['path'] = '/';
// Handle ports // Handle ports
if ( isset($user_home['port']) ) if ( isset($user_home['port']) )
@ -239,7 +241,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) {
if ( isset($redirect['port']) ) if ( isset($redirect['port']) )
$redirect_url .= ':' . $redirect['port']; $redirect_url .= ':' . $redirect['port'];
$redirect_url .= $redirect['path']; $redirect_url .= $redirect['path'];
if ( $redirect['query'] ) if ( isset($redirect['query']) )
$redirect_url .= '?' . $redirect['query']; $redirect_url .= '?' . $redirect['query'];
} }

View File

@ -658,7 +658,7 @@ function _wp_filter_build_unique_id($tag, $function, $priority) {
if ( !isset($function[0]->wp_filter_id) ) { if ( !isset($function[0]->wp_filter_id) ) {
if ( false === $priority ) if ( false === $priority )
return false; return false;
$count = isset($wp_filter[$tag]) ? count((array)$wp_filter[$tag][$priority]) : 0; $count = isset($wp_filter[$tag][$priority]) ? count((array)$wp_filter[$tag][$priority]) : 0;
$function[0]->wp_filter_id = $count; $function[0]->wp_filter_id = $count;
$obj_idx .= $count; $obj_idx .= $count;
unset($count); unset($count);

View File

@ -28,10 +28,8 @@
function get_attached_file( $attachment_id, $unfiltered = false ) { function get_attached_file( $attachment_id, $unfiltered = false ) {
$file = get_post_meta( $attachment_id, '_wp_attached_file', true ); $file = get_post_meta( $attachment_id, '_wp_attached_file', true );
// If the file is relative, prepend upload dir // If the file is relative, prepend upload dir
if ( 0 !== strpos($file, '/') ) { if ( 0 !== strpos($file, '/') && ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) )
$uploads = wp_upload_dir();
$file = $uploads['basedir'] . "/$file"; $file = $uploads['basedir'] . "/$file";
}
if ( $unfiltered ) if ( $unfiltered )
return $file; return $file;