From 45b01cb941b268cc15f9828c1c73782e9e740c5d Mon Sep 17 00:00:00 2001 From: yurabakhtin Date: Thu, 9 Jun 2016 07:43:28 +0300 Subject: [PATCH] Fix a preview of posts with not allowed front office statuses --- inc/skins/_skin.funcs.php | 2 +- skins_fallback_v6/_item_meta_comments.inc.php | 2 +- skins_fallback_v6/_item_workflow.inc.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/skins/_skin.funcs.php b/inc/skins/_skin.funcs.php index 587d9bf3c83..acb02dd730b 100644 --- a/inc/skins/_skin.funcs.php +++ b/inc/skins/_skin.funcs.php @@ -179,7 +179,7 @@ function skin_init( $disp ) // Check if the post has allowed front office statuses $allowed_statuses = get_inskin_statuses( $Blog->ID, 'post' ); - if( ! in_array( $Item->status, $allowed_statuses ) ) + if( ! $preview && ! in_array( $Item->status, $allowed_statuses ) ) { global $disp; $disp = '404'; diff --git a/skins_fallback_v6/_item_meta_comments.inc.php b/skins_fallback_v6/_item_meta_comments.inc.php index b8a0fd5c0ca..08ca517178e 100644 --- a/skins_fallback_v6/_item_meta_comments.inc.php +++ b/skins_fallback_v6/_item_meta_comments.inc.php @@ -17,7 +17,7 @@ global $disp; if( ( $disp == 'single' || $disp == 'page' ) && - ! empty( $Item ) && + isset( $Item ) && $Item->ID > 0 && is_logged_in() && $current_User->check_perm( 'meta_comment', 'view', false, $Item ) ) { // Display the meta comments if current user can edit this post: diff --git a/skins_fallback_v6/_item_workflow.inc.php b/skins_fallback_v6/_item_workflow.inc.php index cefcb46eb6d..2874275ea86 100644 --- a/skins_fallback_v6/_item_workflow.inc.php +++ b/skins_fallback_v6/_item_workflow.inc.php @@ -16,7 +16,7 @@ global $disp; if( ( $disp == 'single' || $disp == 'page' ) && - ! empty( $Item ) && + isset( $Item ) && $Item->ID > 0 && is_logged_in() && $Blog->get_setting( 'use_workflow' ) && $current_User->check_perm( 'blog_can_be_assignee', 'edit', false, $Blog->ID ) &&