From 666bfd2d91de3808220d6331ee241ccf21322c71 Mon Sep 17 00:00:00 2001 From: ryan Date: Tue, 28 Aug 2007 18:58:54 +0000 Subject: [PATCH] Don't return permalink for non-existent post. Props Viper007Bond. fixes #4834 git-svn-id: http://svn.automattic.com/wordpress/trunk@5956 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 0b4c43989..ac5c31c01 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -60,6 +60,9 @@ function get_permalink($id = 0) { ); $post = &get_post($id); + + if ( empty($post->ID) ) return FALSE; + if ( $post->post_type == 'page' ) return get_page_link($post->ID); elseif ($post->post_type == 'attachment')