From 7b76e29ab3c9258c87f318aaa9f66e10ac976e66 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Fri, 15 Mar 2013 10:18:55 +0200 Subject: Don't complain about missing fileData --- gsxlib.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'gsxlib.php') diff --git a/gsxlib.php b/gsxlib.php index fae862e..740323b 100644 --- a/gsxlib.php +++ b/gsxlib.php @@ -192,14 +192,17 @@ class GsxLib public function createCarryInRepair($repairData) { - if( $repairData['fileData'] && file_exists( $repairData['fileData'] )) + if( array_key_exists('fileData', $repairData )) { $fp = $repairData['fileData']; - $fh = fopen($fp, "r"); - $contents = fread($fh, filesize($fp)); - $repairData['fileData'] = $contents; - $repairData['fileName'] = basename($fp); - fclose($fh); + if( is_readable( $fp )) + { + $fh = fopen($fp, "r"); + $contents = fread($fh, filesize($fp)); + $repairData['fileData'] = $contents; + $repairData['fileName'] = basename($fp); + fclose($fh); + } } $resp = $this->client->CreateCarryInRepair( -- cgit v1.2.3