Notice fixes. See #7509 props DD32.

git-svn-id: https://develop.svn.wordpress.org/trunk@9177 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood
2008-10-14 21:08:28 +00:00
parent 7272eff0b2
commit 3ec2c1ea4e
3 changed files with 5 additions and 5 deletions

View File

@@ -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;