Passed
Push — master ( cb7f05...ef3a6d )
by Cody
03:11
created
functions/post_messages.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
         $uploadOk = true;
14 14
         $imageFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION));
15 15
         $check = getimagesize($_FILES["file"]["tmp_name"]);
16
-        if($imageFileType != "webm" && $imageFileType != "mp4"){
16
+        if ($imageFileType != "webm" && $imageFileType != "mp4") {
17 17
           if ($check !== false) {
18 18
             $uploadOk = true;
19
-          } else {
19
+          }else {
20 20
             echo "what are you doing anon? that file was not an image or a webm...";
21 21
             $uploadOk = false;
22 22
           }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         // Upload the file
38 38
         if ($uploadOk == false) {
39 39
             echo "Sorry, your file was not uploaded.";
40
-        } else {
40
+        }else {
41 41
             move_uploaded_file($_FILES["file"]["tmp_name"], $target_file);
42 42
         }
43 43
       }
@@ -60,19 +60,19 @@  discard block
 block discarded – undo
60 60
       array_push($messages["messages"], $new_message);
61 61
       $jsondata = json_encode($messages, JSON_PRETTY_PRINT);
62 62
 
63
-      if(isset($_FILES['file']['name']) && $_FILES['file']['name'] != ""){
64
-        if($uploadOk){
63
+      if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != "") {
64
+        if ($uploadOk) {
65 65
           file_put_contents($file, $jsondata);
66 66
         }
67 67
       }elseif (!(isset($_FILES['file']['name']) && $_FILES['file']['name'] != "")) {
68 68
         file_put_contents($file, $jsondata);
69 69
       }
70
-    } else {
70
+    }else {
71 71
       echo "The message field is <b>required</b>.";
72 72
     }
73 73
   }
74 74
 
75
-  function greenText($msg){
75
+  function greenText($msg) {
76 76
     preg_match_all('/(?<!&gt;)&gt;(?!&gt;).*/', $msg, $matches, PREG_SET_ORDER, 0);
77 77
 
78 78
     foreach ($matches as $m) {
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
         if($uploadOk){
65 65
           file_put_contents($file, $jsondata);
66 66
         }
67
-      }elseif (!(isset($_FILES['file']['name']) && $_FILES['file']['name'] != "")) {
67
+      } elseif (!(isset($_FILES['file']['name']) && $_FILES['file']['name'] != "")) {
68 68
         file_put_contents($file, $jsondata);
69 69
       }
70 70
     } else {
Please login to merge, or discard this patch.