Index: post-template.php
===================================================================
--- post-template.php	(revision 25397)
+++ post-template.php	(working copy)
@@ -1253,14 +1253,21 @@
  * @uses $wp_query
  *
  * @param string $template The specific template name if specific matching is required.
+ * @param bool $loop Whether is_page_template() should be available in the loop.
  * @return bool True on success, false on failure.
  */
-function is_page_template( $template = '' ) {
-	if ( ! is_page() )
+function is_page_template( $template = '', $loop = false ) {
+    // Bail if (1) not a page and not in the loop or (2) in loop and not available in loop
+	if ( ( ! is_page() && ! in_the_loop() ) || ( in_the_loop() && ! $loop ) )
 		return false;
+    
+    if ( in_the_loop() ) {
+        global $wp_the_query;
+        $page_template = get_page_template_slug( $wp_the_query->queried_object_id );
+    } else {
+        $page_template = get_page_template_slug( get_queried_object_id() );
+    }
 
-	$page_template = get_page_template_slug( get_queried_object_id() );
-
 	if ( empty( $template ) )
 		return (bool) $page_template;
 
