浏览代码

open file rw only if it is writable

tokul 20 年之前
父节点
当前提交
06741d07c7
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      functions/abook_local_file.php

+ 1 - 1
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) {