From: tokul Date: Wed, 9 Feb 2005 16:03:56 +0000 (+0000) Subject: open file rw only if it is writable X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=d5d43e5767a6d22566977b114d56cd8974b30deb;p=squirrelmail.git open file rw only if it is writable git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8831 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/abook_local_file.php b/functions/abook_local_file.php index ee158405..d22114f6 100644 --- a/functions/abook_local_file.php +++ b/functions/abook_local_file.php @@ -132,7 +132,7 @@ class abook_local_file extends addressbook_backend { $this->error = ''; $file = $this->filename; $create = $this->create; - $fopenmode = ($this->writeable ? 'a+' : 'r'); + $fopenmode = (($this->writeable && is_writable($file)) ? 'a+' : 'r'); /* Return true is file is open and $new is unset */ if($this->filehandle && !$new) {