From 8afea491a9cb55bcea43e74a519d1305da1a815a Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Tue, 22 Jan 2008 22:14:01 +1300 Subject: [PATCH] Fix for when open_basedir is in force. --- inc/caldav-PUT.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/inc/caldav-PUT.php b/inc/caldav-PUT.php index cf8b9d57..13933273 100644 --- a/inc/caldav-PUT.php +++ b/inc/caldav-PUT.php @@ -14,10 +14,12 @@ if ( ! $request->AllowedTo("read") ) { $request->DoResponse(403); } -if ( isset($c->dbg['ALL']) || $c->dbg['put'] ) { +if ( ! ini_get('open_basedir') && (isset($c->dbg['ALL']) || $c->dbg['put']) ) { $fh = fopen('/tmp/PUT.txt','w'); - fwrite($fh,$request->raw_post); - fclose($fh); + if ( $fh ) { + fwrite($fh,$request->raw_post); + fclose($fh); + } } include_once('caldav-PUT-functions.php');