From 4754493e531a2f6cfe4404c302a8de3cf3ba0190 Mon Sep 17 00:00:00 2001 From: Savetheinternet Date: Tue, 2 Nov 2010 22:58:19 +1100 Subject: [PATCH] Error handling --- inc/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 32a943f7..af10f40d 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -79,7 +79,7 @@ if(file_exists($filename)) $md5 = md5_file($filename); $content['pages'] = $pages; - file_put_contents($filename, Element('index.html', $content)) or error("Couldn't write to file."); + @file_put_contents($filename, Element('index.html', $content)) or error("Couldn't write to file."); if(isset($md5) && $md5 == md5_file($filename)) { break; @@ -189,7 +189,7 @@ } else { $thread->add(new Post($post['id'], $thread->id, $post['subject'], $post['email'], $post['name'], $post['trip'], $post['body'], $post['time'], $post['thumb'], $post['thumbwidth'], $post['thumbheight'], $post['file'], $post['filewidth'], $post['fileheight'], $post['filesize'], $post['filename'])); } - file_put_contents(DIR_RES . $id . '.html', Element('thread.html', Array('button'=>BUTTON_REPLY, 'board'=>$board, 'body'=>$thread->build(), 'post_url' => POST_URL, 'index' => ROOT, 'id' => $id))) or error("Couldn't write to file."); + @file_put_contents(DIR_RES . $id . '.html', Element('thread.html', Array('button'=>BUTTON_REPLY, 'board'=>$board, 'body'=>$thread->build(), 'post_url' => POST_URL, 'index' => ROOT, 'id' => $id))) or error("Couldn't write to file."); } mysql_free_result($query); }