Passed
Pull Request — master (#20)
by
unknown
02:03
created
media.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
                 $stmt = $conn->prepare("SELECT * FROM files WHERE id = 27");
20 20
                 $stmt->execute();
21 21
                 $result = $stmt->get_result();
22
-                while($row = $result->fetch_assoc()) {
22
+                while ($row = $result->fetch_assoc()) {
23 23
                     echo "<br><img style='height: 5em;position: absolute;border: 1px solid white; width: 5em;' src='pfp/" . getPFP($row['author'], $conn) . "'>
24 24
                     <small>
25 25
                     <a href='view.php?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>[" . $row['agerating'] . "] " . $row['title'] . "</a></i></span><br>
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
                 $stmt = $conn->prepare("SELECT * FROM files WHERE id = 1");
39 39
                 $stmt->execute();
40 40
                 $result = $stmt->get_result();
41
-                while($row = $result->fetch_assoc()) {
41
+                while ($row = $result->fetch_assoc()) {
42 42
                     echo "<br><img style='height: 5em;position: absolute;border: 1px solid white; width: 5em;' src='pfp/" . getPFP($row['author'], $conn) . "'>
43 43
                     <small>
44 44
                     <a href='view.php?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>[" . $row['agerating'] . "] " . $row['title'] . "</a></i></span><br>
Please login to merge, or discard this patch.
updateinfo.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,18 +12,18 @@
 block discarded – undo
12 12
     <body> 
13 13
         <?php require(__DIR__ . "/important/header.php"); 
14 14
         
15
-        if(isset($_GET['id'])) {
15
+        if (isset($_GET['id'])) {
16 16
             $stmt = $conn->prepare("SELECT * FROM files WHERE author = ? AND id = ?");
17 17
             $stmt->bind_param("si", $_SESSION['user'], $_GET['id']);
18 18
             $stmt->execute();
19 19
             $result = $stmt->get_result();
20
-            if($result->num_rows === 0) die('Item doesnt exist or item isnt made by you.');
20
+            if ($result->num_rows === 0) die('Item doesnt exist or item isnt made by you.');
21 21
         } else {
22 22
             header("Location: index.php");
23 23
         }
24 24
 
25
-        if(@$_POST['submit']) {
26
-            if(isset($_SESSION['user'])) {
25
+        if (@$_POST['submit']) {
26
+            if (isset($_SESSION['user'])) {
27 27
                 $stmt = $conn->prepare("UPDATE files SET title = ?, extrainfo = ? WHERE id = ?");
28 28
                 $stmt->bind_param("ssi", $title, $description, $_GET['id']);
29 29
                 $title = htmlspecialchars($_POST['title']);
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -17,7 +17,9 @@
 block discarded – undo
17 17
             $stmt->bind_param("si", $_SESSION['user'], $_GET['id']);
18 18
             $stmt->execute();
19 19
             $result = $stmt->get_result();
20
-            if($result->num_rows === 0) die('Item doesnt exist or item isnt made by you.');
20
+            if($result->num_rows === 0) {
21
+                die('Item doesnt exist or item isnt made by you.');
22
+            }
21 23
         } else {
22 24
             header("Location: index.php");
23 25
         }
Please login to merge, or discard this patch.
newnews.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
     <body> 
13 13
         <?php require(__DIR__ . "/important/header.php"); 
14 14
         
15
-        if(@$_POST['submit']) {
16
-            if(isset($_SESSION['user'])) {
15
+        if (@$_POST['submit']) {
16
+            if (isset($_SESSION['user'])) {
17 17
                 $stmt = $conn->prepare("INSERT INTO files (type, title, extrainfo, author, filename) VALUES ('news', ?, ?, ?, '')");
18 18
                 $stmt->bind_param("sss", $title, $description, $_SESSION['user']);
19 19
 
Please login to merge, or discard this patch.
joingroup.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -2,13 +2,13 @@
 block discarded – undo
2 2
 require(__DIR__ . "/func/func.php");
3 3
 require(__DIR__ . "/func/conn.php"); 
4 4
 
5
-if(isset($_SESSION['user'])) {
6
-    if(isset($_GET['id'])) {
5
+if (isset($_SESSION['user'])) {
6
+    if (isset($_GET['id'])) {
7 7
         $stmt = $conn->prepare("SELECT * FROM `groups` WHERE id = ?");
8 8
         $stmt->bind_param("i", $_GET['id']);
9 9
         $stmt->execute();
10 10
         $result = $stmt->get_result();
11
-        if($result->num_rows === 0) {
11
+        if ($result->num_rows === 0) {
12 12
             die("Group doesn't exist");
13 13
         }
14 14
         $stmt->close();
Please login to merge, or discard this patch.
newgroup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
     <body> 
13 13
         <?php require("important/header.php"); 
14 14
         
15
-        if(@$_POST['submit']) {
16
-            if(isset($_SESSION['user'])) {
15
+        if (@$_POST['submit']) {
16
+            if (isset($_SESSION['user'])) {
17 17
                 $stmt = $conn->prepare("INSERT INTO `groups` (title, description, author) VALUES (?, ?, ?)");
18 18
                 $stmt->bind_param("sss", $name, $text, $_SESSION['user']);
19 19
                 $text = htmlspecialchars($_POST['description']);
Please login to merge, or discard this patch.
home.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,9 @@
 block discarded – undo
9 9
             $stmt->bind_param("s", $_SESSION['user']);
10 10
             $stmt->execute();
11 11
             $result = $stmt->get_result();
12
-            if($result->num_rows === 0) header('Location: index.php');
12
+            if($result->num_rows === 0) {
13
+                header('Location: index.php');
14
+            }
13 15
             while($row = $result->fetch_assoc()) {
14 16
                 $username = $row['username'];
15 17
                 $id = $row['id'];
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
             $stmt->bind_param("s", $_SESSION['user']);
10 10
             $stmt->execute();
11 11
             $result = $stmt->get_result();
12
-            if($result->num_rows === 0) header('Location: index.php');
13
-            while($row = $result->fetch_assoc()) {
12
+            if ($result->num_rows === 0) header('Location: index.php');
13
+            while ($row = $result->fetch_assoc()) {
14 14
                 $username = $row['username'];
15 15
                 $id = $row['id'];
16 16
                 $date = $row['date'];
@@ -28,21 +28,21 @@  discard block
 block discarded – undo
28 28
     <body> 
29 29
         <?php require(__DIR__ . "/important/header.php"); 
30 30
         
31
-        if(@$_POST['bioset']) {
31
+        if (@$_POST['bioset']) {
32 32
             $stmt = $conn->prepare("UPDATE users SET bio = ? WHERE `users`.`username` = ?;");
33 33
             $stmt->bind_param("ss", $text, $_SESSION['user']);
34 34
             $text = $_POST['bio'];
35 35
             $stmt->execute(); 
36 36
             $stmt->close();
37 37
             header("Location: home.php");
38
-        } else if(@$_POST['css']) {
38
+        } else if (@$_POST['css']) {
39 39
             $stmt = $conn->prepare("UPDATE users SET css = ? WHERE `users`.`username` = ?;");
40 40
             $stmt->bind_param("ss", $validatedcss, $_SESSION['user']);
41 41
             $validatedcss = validateCSS($_POST['css']);
42 42
             $stmt->execute(); 
43 43
             $stmt->close();
44 44
             header("Location: home.php");
45
-        } else if(@$_POST['submit']) {
45
+        } else if (@$_POST['submit']) {
46 46
             $target_dir = "dynamic/pfp/";
47 47
             $target_name = md5_file($_FILES["fileToUpload"]["tmp_name"]);
48 48
             $imageFileType = strtolower(pathinfo($$_FILES["fileToUpload"]["name"], PATHINFO_EXTENSION));
@@ -50,9 +50,9 @@  discard block
 block discarded – undo
50 50
             $target_file = $target_dir . $target_name . "." . $imageFileType;
51 51
             
52 52
             $uploadOk = 1;
53
-            if(isset($_POST["submit"])) {
53
+            if (isset($_POST["submit"])) {
54 54
                 $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
55
-                if($check !== false) {
55
+                if ($check !== false) {
56 56
                     $uploadOk = 1;
57 57
                 } else {
58 58
                     $uploadOk = 0;
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 //                echo 'file with the same name already exists<hr>';
63 63
 //                $uploadOk = 0;
64 64
 //            }
65
-            if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
66
-            && $imageFileType != "gif" ) {
65
+            if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
66
+            && $imageFileType != "gif") {
67 67
                 echo 'unsupported file type. must be jpg, png, jpeg, or gif<hr>';
68 68
                 $uploadOk = 0;
69 69
             }
@@ -79,15 +79,15 @@  discard block
 block discarded – undo
79 79
                     echo 'fatal error<hr>';
80 80
                 }
81 81
             }
82
-        } else if(@$_POST['photoset']) {
82
+        } else if (@$_POST['photoset']) {
83 83
             $uploadOk = true;
84 84
             $target_dir = "music/";
85 85
             $target_file = basename($_FILES["fileToUpload"]["name"]);
86 86
             $imageFileType = strtolower(pathinfo($target_file, PATHINFO_EXTENSION));
87 87
             $target_file = $target_dir . getID($_SESSION['user'], $conn) . "." . $imageFileType;
88
-            if(isset($_POST["submit"])) {
88
+            if (isset($_POST["submit"])) {
89 89
                 $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]);
90
-                if($check !== false) {
90
+                if ($check !== false) {
91 91
                     $uploadOk = true;
92 92
                 } else {
93 93
                     $uploadOk = false;
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 //                echo 'file with the same name already exists<hr>';
98 98
 //                $uploadOk = false;
99 99
 //            }
100
-            if($imageFileType != "ogg" && $imageFileType != "mp3") {
100
+            if ($imageFileType != "ogg" && $imageFileType != "mp3") {
101 101
                 echo 'unsupported file type. must be mp3 or ogg<hr>';
102 102
                 $uploadOk = false;
103 103
             }
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
             <button><a href="/2fa">Manage 2-Factor Authentication</a></button><br><br>
131 131
             <b>Bio</b>
132 132
             <form method="post" enctype="multipart/form-data">
133
-                <textarea required cols="58" placeholder="Bio" name="bio"><?php echo $bio;?></textarea><br>
133
+                <textarea required cols="58" placeholder="Bio" name="bio"><?php echo $bio; ?></textarea><br>
134 134
                 <input name="bioset" type="submit" value="Set">
135 135
                 <small>max limit: 500 characters | supports <a href="https://www.markdownguide.org/basic-syntax">Markdown</a></small>
136 136
             </form><br>
137 137
             <b>CSS</b>
138 138
             <button onclick="loadpfwin()" id="prevbtn">Show Live CSS Preview</button>
139 139
             <form method="post" enctype="multipart/form-data">
140
-                <textarea required rows="15" cols="58" placeholder="Your CSS" name="css" id="css_code"><?php echo $css;?></textarea><br>
140
+                <textarea required rows="15" cols="58" placeholder="Your CSS" name="css" id="css_code"><?php echo $css; ?></textarea><br>
141 141
                 <input name="cssset" type="submit" value="Set"> <small>max limit: 5000 characters</small>
142 142
             </form><br>
143 143
         </div>
Please login to merge, or discard this patch.
important/header.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,9 @@
 block discarded – undo
5 5
         $stmt->execute();
6 6
         $result = $stmt->get_result();
7 7
     
8
-        if($result->num_rows == 0) echo('welcome to gamestop how may i help you');
8
+        if($result->num_rows == 0) {
9
+            echo('welcome to gamestop how may i help you');
10
+        }
9 11
     }
10 12
 ?>
11 13
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2
-    if(isset($_SESSION['user'])) {
2
+    if (isset($_SESSION['user'])) {
3 3
         $stmt = $conn->prepare("SELECT * FROM `users` WHERE username = ?");
4 4
         $stmt->bind_param("s", $_SESSION['user']);
5 5
         $stmt->execute();
6 6
         $result = $stmt->get_result();
7 7
     
8
-        if($result->num_rows == 0) echo('welcome to gamestop how may i help you');
8
+        if ($result->num_rows == 0) echo('welcome to gamestop how may i help you');
9 9
     }
10 10
 ?>
11 11
 
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
     &bull; <a href="/view/groups">Groups</a>
32 32
 
33 33
     <span style="float:right;">
34
-        <?php if(isset($_SESSION['user'])) {?>
34
+        <?php if (isset($_SESSION['user'])) {?>
35 35
         Logged in as 
36
-        <a href='/view/profile?id=<?php echo(getID($_SESSION['user'], $conn));?>'>
37
-            <?php echo($_SESSION['user']);?>
36
+        <a href='/view/profile?id=<?php echo(getID($_SESSION['user'], $conn)); ?>'>
37
+            <?php echo($_SESSION['user']); ?>
38 38
         </a>
39 39
         &bull; <a href='/home'>Manage</a>
40 40
         &bull; <a href='/logout'>Logout</a>
Please login to merge, or discard this patch.
adminpanel/ban.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 require("dependencies.php");
3 3
 
4
-if(isset($_SESSION['user'])) {
5
-    if(isset($_GET['id'])) {
6
-        if(isAdmin($_SESSION['user'], $conn) == "admin") {
4
+if (isset($_SESSION['user'])) {
5
+    if (isset($_GET['id'])) {
6
+        if (isAdmin($_SESSION['user'], $conn) == "admin") {
7 7
             $stmt = $conn->prepare("DELETE FROM users WHERE id = ?");
8 8
             $stmt->bind_param("i", $_GET['id']);
9 9
             $stmt->execute();
Please login to merge, or discard this patch.
adminpanel/deny.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 require("dependencies.php");
3 3
 
4
-if(isset($_SESSION['user'])) {
5
-    if(isset($_GET['id'])) {
6
-        if(isAdmin($_SESSION['user'], $conn) == "admin") {
4
+if (isset($_SESSION['user'])) {
5
+    if (isset($_GET['id'])) {
6
+        if (isAdmin($_SESSION['user'], $conn) == "admin") {
7 7
             $stmt = $conn->prepare("UPDATE files SET status = 'd' WHERE id = ?");
8 8
             $stmt->bind_param("i", $_GET['id']);
9 9
             $stmt->execute();
Please login to merge, or discard this patch.