diff options
-rw-r--r-- | inc/common.php | 19 | ||||
-rw-r--r-- | style.css | 6 |
2 files changed, 21 insertions, 4 deletions
diff --git a/inc/common.php b/inc/common.php index afff702d2..2e146d485 100644 --- a/inc/common.php +++ b/inc/common.php @@ -662,13 +662,20 @@ function dbg($msg,$hidden=false){ */ function addLogEntry($date,$id,$summary=""){ global $conf; - $id = cleanID($id); + $id = cleanID($id);//FIXME not needed anymore? + + if(!@is_writable($conf['changelog'])){ + msg($conf['changelog'].' is not writable!',-1); + return; + } + if(!$date) $date = time(); //use current time if none supplied $remote = $_SERVER['REMOTE_ADDR']; $user = $_SERVER['REMOTE_USER']; $logline = join("\t",array($date,$remote,$id,$user,$summary))."\n"; + //FIXME: use adjusted io_saveFile instead $fh = fopen($conf['changelog'],'a'); if($fh){ fwrite($fh,$logline); @@ -687,6 +694,11 @@ function getRecents($num=0,$incdel=false){ $recent = array(); if(!$num) $num = $conf['recent']; + if(!@is_readable($conf['changelog'])){ + msg($conf['changelog'].' is not readable',-1); + return $recent; + } + $loglines = file($conf['changelog']); rsort($loglines); //reverse sort on timestamp @@ -720,6 +732,11 @@ function getRecents($num=0,$incdel=false){ */ function getRevisionInfo($id,$rev){ global $conf; + $info = array(); + if(!@is_readable($conf['changelog'])){ + msg($conf['changelog'].' is not readable',-1); + return $recent; + } $loglines = file($conf['changelog']); $loglines = preg_grep("/$rev\t\d+\.\d+\.\d+\.\d+\t$id\t/",$loglines); rsort($loglines); //reverse sort on timestamp (shouldn't be needed) @@ -165,21 +165,21 @@ span.user{ } div.error{ - background: #ff6666; url(images/error.png) 0.5em 0px no-repeat; + background: #ff6666 url(images/error.png) 0.5em 0px no-repeat; font-size: 90%; margin: 0px; padding-left: 3em; } div.info{ - background: #ffff66; url(images/info.png) 0.5em 0px no-repeat; + background: #ffff66 url(images/info.png) 0.5em 0px no-repeat; font-size: 90%; margin: 0; padding-left: 3em; } div.success{ - background: #66ff66; url(images/thumbup.gif) 0.5em 0px no-repeat; + background: #66ff66 url(images/thumbup.gif) 0.5em 0px no-repeat; font-size: 90%; margin: 0; padding-left: 3em; |