# HG changeset patch # User Giulio Moro # Date 1456237105 0 # Node ID 4cc5bc731a3dba58bc86d80879c49fb16cdfbdd6 # Parent adbaff4bf3f065ca97e1b8cb2b201ea06bae4cec Added error check for empty file in save.php diff -r adbaff4bf3f0 -r 4cc5bc731a3d 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 +?>