From a0f339d3bfd34432fd420a398570376b03d140ff Mon Sep 17 00:00:00 2001 From: westi Date: Tue, 14 Oct 2008 21:08:28 +0000 Subject: [PATCH] Notice fixes. See #7509 props DD32. git-svn-id: http://svn.automattic.com/wordpress/trunk@9177 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/canonical.php | 4 +++- wp-includes/plugin.php | 2 +- wp-includes/post.php | 4 +--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index 4bb5d312fb..8ead88a0e2 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -166,6 +166,8 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { $user_home = @parse_url(get_option('home')); if ( isset($user_home['host']) ) $redirect['host'] = $user_home['host']; + if ( !isset($user_home['path']) ) + $user_home['path'] = '/'; // Handle ports if ( isset($user_home['port']) ) @@ -239,7 +241,7 @@ function redirect_canonical($requested_url=null, $do_redirect=true) { if ( isset($redirect['port']) ) $redirect_url .= ':' . $redirect['port']; $redirect_url .= $redirect['path']; - if ( $redirect['query'] ) + if ( isset($redirect['query']) ) $redirect_url .= '?' . $redirect['query']; } diff --git a/wp-includes/plugin.php b/wp-includes/plugin.php index dc7dfe6812..ccf90260dd 100644 --- a/wp-includes/plugin.php +++ b/wp-includes/plugin.php @@ -658,7 +658,7 @@ function _wp_filter_build_unique_id($tag, $function, $priority) { if ( !isset($function[0]->wp_filter_id) ) { if ( false === $priority ) 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; $obj_idx .= $count; unset($count); diff --git a/wp-includes/post.php b/wp-includes/post.php index 773dd2bba0..53e131469d 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -28,10 +28,8 @@ function get_attached_file( $attachment_id, $unfiltered = false ) { $file = get_post_meta( $attachment_id, '_wp_attached_file', true ); // If the file is relative, prepend upload dir - if ( 0 !== strpos($file, '/') ) { - $uploads = wp_upload_dir(); + if ( 0 !== strpos($file, '/') && ( ($uploads = wp_upload_dir()) && false === $uploads['error'] ) ) $file = $uploads['basedir'] . "/$file"; - } if ( $unfiltered ) return $file;