# HG changeset patch # User Giulio Moro # Date 1456237105 0 # Node ID dc4300033afccc1ab75018e13ca187b027e539aa # Parent 69394f0fd1429a885c6cb07f7b188b8db65d65bd Added error check for empty file in save.php diff -r 69394f0fd142 -r dc4300033afc save.php --- a/save.php Tue Feb 23 12:22:28 2016 +0000 +++ b/save.php Tue Feb 23 14:18:25 2016 +0000 @@ -7,6 +7,13 @@ $datetime = date('ymdHis'); $xmlfile = "save".$datetime."-".$sha1_hash.".xml"; $fileHandle = fopen("saves/".$xmlfile, 'w'); + if (sizeof($postText) <= 1) + { + // Filehandle failed + $xml = 'Input file empty'; + echo $xml; + return; + } if ($fileHandle == FALSE) { // Filehandle failed @@ -27,4 +34,4 @@ // Return JSON confirmation data $xml = 'OK"saves/'.$xmlfile.'"'; echo $xml; -?> \ No newline at end of file +?>