Passed
Push — master ( 273055...1810d5 )
by Cody
01:35
created
index.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 
27 27
   if (!$_SESSION['logged_in'] && $password != "") {
28 28
     require_once("functions/login.php");
29
-  }else if ($_SESSION['logged_in'] || $password == "") {
29
+  } else if ($_SESSION['logged_in'] || $password == "") {
30 30
     // display messages
31 31
     require_once("functions/display_messages.php");
32 32
     $messages = get_messages($file);
Please login to merge, or discard this patch.
functions/login.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2
-if($password != "" && isset($_POST['auth_submit'])){
3
-  if($password != $_POST['password']){
2
+if ($password != "" && isset($_POST['auth_submit'])) {
3
+  if ($password != $_POST['password']) {
4 4
     ?>
5 5
       <b>wrong password</b>, try again.
6 6
     <?php
7
-  } else{
7
+  }else {
8 8
     $_SESSION['logged_in'] = true;
9 9
     echo 'logged in!';
10 10
     header("refresh:0;");
Please login to merge, or discard this patch.
functions/display_messages.php 2 patches
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
       if ($message['file'] != "") {
10 10
         if(substr($message['file'], -4) == "webm" || substr($message['file'], -3) == "mp4"){
11 11
           $display_messages = $display_messages . '<div><video width="600" controls loop><source src="/images/' . $message['file'] . '" type="video/mp4"></video></div><br />';
12
-        }else{
12
+        } else{
13 13
           $display_messages = $display_messages . "<div><a href='images/" . $message['file'] . "'><img src = 'images/" . $message['file'] . "' class='message-image'/></a></div>";
14 14
         }
15 15
       }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,9 +9,9 @@  discard block
 block discarded – undo
9 9
       $display_messages = $display_messages . "<div class='title' id='" . $message['id'] . "'><span class='name'>Anonymous</span> " . $message['date'] . " id. <a href='#" . $message['id'] . "'>" . $message['id'] . "</a></div><div class = 'message-inside'>";
10 10
 
11 11
       if ($message['file'] != "") {
12
-        if(substr($message['file'], -4) == "webm" || substr($message['file'], -3) == "mp4"){
12
+        if (substr($message['file'], -4) == "webm" || substr($message['file'], -3) == "mp4") {
13 13
           $display_messages = $display_messages . '<div><video width="600" controls loop><source src="/images/' . $message['file'] . '" type="video/mp4"></video></div><br />';
14
-        }else{
14
+        }else {
15 15
           $display_messages = $display_messages . "<div><a href='images/" . $message['file'] . "'><img src = 'images/" . $message['file'] . "' class='message-image'/></a></div>";
16 16
         }
17 17
       }
@@ -27,21 +27,21 @@  discard block
 block discarded – undo
27 27
     return $result;
28 28
   }
29 29
 
30
-  function check_empty($msgs){
30
+  function check_empty($msgs) {
31 31
     if (isset($msgs) && $msgs != "") {
32 32
       $msg = $msgs;
33
-    } else {
33
+    }else {
34 34
       $msg = "something's wrong, this nerve is either empty or our brain doesn't have access to this nerve's messages...";
35 35
     }
36 36
     return $msg;
37 37
   }
38 38
 
39
-  function build_result($msg, $last_msg, $action){
39
+  function build_result($msg, $last_msg, $action) {
40 40
     if ($action == "messages") {
41 41
       $result = $msg;
42
-    } else if ($action == "last_msg") {
42
+    }else if ($action == "last_msg") {
43 43
       $result = $last_msg;
44
-    } else {
44
+    }else {
45 45
       $result = "show_messages: parameters <b>must</b> be \$messages and either 'messages' or 'last_msg'";
46 46
     }
47 47
 
Please login to merge, or discard this patch.
functions/post_messages.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -13,10 +13,10 @@  discard block
 block discarded – undo
13 13
         $uploadOk = 1;
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 = 1;
19
-          } else {
19
+          }else {
20 20
             echo "what are you doing anon? that file was not an image or a webm...";
21 21
             $uploadOk = 0;
22 22
           }
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         // Upload the file
38 38
         if ($uploadOk == 0) {
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,12 +60,12 @@  discard block
 block discarded – undo
60 60
       array_push($messages["messages"], $new_message);
61 61
       $jsondata = json_encode($messages, JSON_PRETTY_PRINT);
62 62
       file_put_contents($file, $jsondata);
63
-    } else {
63
+    }else {
64 64
       echo "The message field is <b>required</b>.";
65 65
     }
66 66
   }
67 67
 
68
-  function greenText($msg){
68
+  function greenText($msg) {
69 69
     preg_match_all('/(?<!&gt;)&gt;(?!&gt;).*/', $msg, $matches, PREG_SET_ORDER, 0);
70 70
 
71 71
     foreach ($matches as $m) {
Please login to merge, or discard this patch.