From 312b9c927c1953d2c1945a0d0ba87012bd078436 Mon Sep 17 00:00:00 2001 From: Jenner Date: Fri, 28 Aug 2015 18:04:37 +0800 Subject: [PATCH] fix a warning --- duoshuo/WordPress.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/duoshuo/WordPress.php b/duoshuo/WordPress.php index ba523bc..3c584a8 100644 --- a/duoshuo/WordPress.php +++ b/duoshuo/WordPress.php @@ -436,7 +436,9 @@ public function reset(){ public function commentsOpen($open, $post_id = null) { //if ($this->EMBED || get_post_meta($post_id, 'duoshuo_thread_id', true)) // return false; - $script_name = array_pop( explode( '/', $_SERVER['PHP_SELF'] ) ); + $php_self_info = explode('/', $_SERVER['PHP_SELF']); + $script_name = array_pop( $php_self_info ); + if (preg_match('/wp\-comments\-post\.php$/', $script_name) && get_post_meta($post_id, 'duoshuo_status', true) !== 'disabled') return false;