diff --git a/fof-main.php b/fof-main.php index ca74cbc..dcb2d15 100644 --- a/fof-main.php +++ b/fof-main.php @@ -66,7 +66,9 @@ function fof_log($message, $topic="debug") if(!$p['logging']) return; static $log; - if(!isset($log)) $log = fopen("fof.log", 'a'); + if(!isset($log)) $log = @fopen("fof.log", 'a'); + + if(!$log) return; $message = str_replace ("\n", "\\n", $message); $message = str_replace ("\r", "\\r", $message); diff --git a/prefs.php b/prefs.php index 3b0c29c..ebbeaf4 100644 --- a/prefs.php +++ b/prefs.php @@ -26,6 +26,11 @@ if(isset($_POST['adminprefs'])) $prefs->save(); $message .= ' Saved admin prefs.'; + + if($prefs->get('logging') && !@fopen("fof.log", 'a')) + { + $message .= ' Warning: could not write to log file!'; + } } if(isset($_POST['tagfeed']))