From 49f8e67baf6234b5e14abf553265e852e1007c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sat, 28 Apr 2012 19:59:33 +0200 Subject: [PATCH] Check whether the socket is writable. --- file/lib/data/chat/message/ChatMessageEditor.class.php | 2 +- file/lib/util/ChatUtil.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/file/lib/data/chat/message/ChatMessageEditor.class.php b/file/lib/data/chat/message/ChatMessageEditor.class.php index 00a5caf..0b02865 100644 --- a/file/lib/data/chat/message/ChatMessageEditor.class.php +++ b/file/lib/data/chat/message/ChatMessageEditor.class.php @@ -22,7 +22,7 @@ class ChatMessageEditor extends \wcf\data\DatabaseObjectEditor { public static function create(array $parameters = array()) { try { if (CHAT_SOCKET_IO_PATH) { - if (file_exists(WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock')) { + if (file_exists(WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock') && is_writable(WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock')) { $sock = stream_socket_client('unix://'.WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock', $errno, $errstr, 1); fclose($sock); } diff --git a/file/lib/util/ChatUtil.class.php b/file/lib/util/ChatUtil.class.php index 7d590e6..e701467 100644 --- a/file/lib/util/ChatUtil.class.php +++ b/file/lib/util/ChatUtil.class.php @@ -45,7 +45,7 @@ final class ChatUtil { */ public static function getDiedUsers() { $packageID = \wcf\util\ChatUtil::getPackageID(); - if (CHAT_SOCKET_IO_PATH && file_exists(WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock')) { + if (CHAT_SOCKET_IO_PATH && file_exists(WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock') && is_writable(WCF_DIR.'acp/be.bastelstu.wcf.chat.serverPush/data.sock')) { $sql = "SELECT time FROM