Passed
Push — master ( 11e3e3...65e7a4 )
by Maxwell
46s queued 10s
created
upload/chiptune.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     <body> 
13 13
         <?php require(__DIR__ . "/../important/header.php"); 
14 14
         
15
-        if(@$_POST['submit']) {
15
+        if (@$_POST['submit']) {
16 16
             $register = require(__DIR__ . "/../func/upload.php");
17 17
             $register("chiptune", ["xm", "mod", "s3m", "it"], $conn);
18 18
         }
Please login to merge, or discard this patch.
upload/song.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     <body> 
13 13
         <?php require(__DIR__ . "/../important/header.php"); 
14 14
         
15
-        if(@$_POST['submit']) {
15
+        if (@$_POST['submit']) {
16 16
             $register = require(__DIR__ . "/../func/upload.php");
17 17
             $register("song", ["ogg", "mp3"], $conn);
18 18
         }
Please login to merge, or discard this patch.
upload/image.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
     <body> 
13 13
         <?php require(__DIR__ . "/../important/header.php"); 
14 14
         
15
-        if(@$_POST['submit']) {
15
+        if (@$_POST['submit']) {
16 16
             $register = require(__DIR__ . "/../func/upload.php");
17 17
             $register("image", ["gif", "png", "jpg", "jpeg"], $conn);
18 18
         }
Please login to merge, or discard this patch.
2fa/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@
 block discarded – undo
21 21
         <?php require(__DIR__ . "/../important/header.php"); ?>
22 22
         <div class="container">
23 23
              <h1>2-Factor Authentication</h1>
24
-             2FA status: <?php if ($otpstatus) {echo "enabled";} else {echo "disabled";}?><br>
25
-             <?php if ($otpstatus) {echo "Backup code: " . $result->fetch_assoc()['otpbackupcode'];} ?><br><br>
24
+             2FA status: <?php if ($otpstatus) {echo "enabled"; } else {echo "disabled"; }?><br>
25
+             <?php if ($otpstatus) {echo "Backup code: " . $result->fetch_assoc()['otpbackupcode']; } ?><br><br>
26 26
              <button>
27 27
              <?php if ($otpstatus) { ?>
28 28
              <a href="/2fa/disable">Disable 2FA</a>
Please login to merge, or discard this patch.
2fa/enable.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,12 +43,12 @@
 block discarded – undo
43 43
     <body>
44 44
         <?php require(__DIR__ . "/../important/header.php"); ?>
45 45
         <div class="container">
46
-            <?php if (isset($err)) {echo "<b style='color:red;'>" . $err . "</b><br><br>";}?>
46
+            <?php if (isset($err)) {echo "<b style='color:red;'>" . $err . "</b><br><br>"; }?>
47 47
             To enable 2FA, scan the following QR code with your authenticator app:<br><br>
48 48
             <img src="<?php echo $totp->getQrCodeUri(
49 49
                 'https://api.qrserver.com/v1/create-qr-code/?data=[DATA]&size=300x300&ecc=M&qzone=1&format=png',
50 50
                 '[DATA]'
51
-            );?>"><br><br>
51
+            ); ?>"><br><br>
52 52
             Or use the following string: <b><?php echo $secret; ?></b><br>
53 53
             Then type the 6-digit code your app generates below and click 'Submit':<br><br>
54 54
             <form method="post" enctype="multipart/form-data">
Please login to merge, or discard this patch.
view/profile.php 2 patches
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
         $stmt->bind_param("i", $_GET['id']);
17 17
         $stmt->execute();
18 18
         $result = $stmt->get_result();
19
-        if($result->num_rows !== 0){ // echo('There are no users.'); // please just refuse to give a user if this is the case
20
-            while($row = $result->fetch_assoc()) { // you dont need to use a loop if its only ever gonna return 1 or 0
19
+        if ($result->num_rows !== 0) { // echo('There are no users.'); // please just refuse to give a user if this is the case
20
+            while ($row = $result->fetch_assoc()) { // you dont need to use a loop if its only ever gonna return 1 or 0
21 21
                 $username = $row['username']; // you dont actually need all of these variables oh my god just use an array
22 22
                 $id = $row['id'];
23 23
                 $date = $row['date'];
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
         $stmt->bind_param("i", $currentgroup);
42 42
         $stmt->execute();
43 43
         $result = $stmt->get_result();
44
-        if($result->num_rows !== 0){ //echo('There are no users.'); // why again
45
-            while($row = $result->fetch_assoc()) {
44
+        if ($result->num_rows !== 0) { //echo('There are no users.'); // why again
45
+            while ($row = $result->fetch_assoc()) {
46 46
                 $grouptitle = $row['title'];
47 47
             }
48
-        }else{
48
+        } else {
49 49
             $grouptitle = "none";
50 50
         }
51 51
         $stmt->close();
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
         $result = $stmt->get_result();
57 57
 
58 58
         $comments = 0;
59
-        while($row = $result->fetch_assoc()) {
59
+        while ($row = $result->fetch_assoc()) {
60 60
             $comments++;
61 61
         }
62 62
         $stmt->close();
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
         $result = $stmt->get_result();
68 68
 
69 69
         $profilecomments = 0;
70
-        while($row = $result->fetch_assoc()) {
70
+        while ($row = $result->fetch_assoc()) {
71 71
             $profilecomments++;
72 72
         }
73 73
         $stmt->close();
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
         $result = $stmt->get_result();
79 79
 
80 80
         $filesuploaded = 0;
81
-        while($row = $result->fetch_assoc()) {
81
+        while ($row = $result->fetch_assoc()) {
82 82
             $filesuploaded++;
83 83
         }
84 84
         $stmt->close();
@@ -96,12 +96,12 @@  discard block
 block discarded – undo
96 96
                         </center>
97 97
                         <hr style="border-top: 1px dashed gray;">
98 98
                         <div id="userinfo" style="padding-left: 20px;">
99
-                            <span style="color: gold;">Rank:</span> <?php echo $rank;?><br>
100
-                            <span style="color: gold;">ID:</span> <?php echo $id;?><br>
101
-                            <span style="color: gold;">Other Comments:</span> <?php echo $comments;?><br>
102
-                            <span style="color: gold;">Profile Comments:</span> <?php echo $profilecomments;?><br>
103
-                            <span style="color: gold;">Current Group:</span> <?php echo $grouptitle;?><br>
104
-                            <span style="color: gold;">Files Uploaded:</span> <?php echo $filesuploaded;?>
99
+                            <span style="color: gold;">Rank:</span> <?php echo $rank; ?><br>
100
+                            <span style="color: gold;">ID:</span> <?php echo $id; ?><br>
101
+                            <span style="color: gold;">Other Comments:</span> <?php echo $comments; ?><br>
102
+                            <span style="color: gold;">Profile Comments:</span> <?php echo $profilecomments; ?><br>
103
+                            <span style="color: gold;">Current Group:</span> <?php echo $grouptitle; ?><br>
104
+                            <span style="color: gold;">Files Uploaded:</span> <?php echo $filesuploaded; ?>
105 105
                         </div><br>
106 106
                         <?php if (!isset($_GET["ed"])) { ?>
107 107
                             <audio autoplay controls>
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
                     </div>
112 112
                     <br>
113 113
                     <div class="notegray">
114
-                    <?php if(isset($error)) { echo "<small style='color:red'>".$error."</small>"; } ?>
114
+                    <?php if (isset($error)) { echo "<small style='color:red'>" . $error . "</small>"; } ?>
115 115
                     <h2>Comment</h2>
116 116
                     <form method="post" enctype="multipart/form-data">
117 117
                         <textarea required cols="33" placeholder="Comment" name="comment"></textarea><br>
@@ -130,8 +130,8 @@  discard block
 block discarded – undo
130 130
                     <div id="badges" class="notegray">
131 131
                         <h1>Badges</h1>
132 132
                         <?php
133
-                            foreach($badges as $badge) {
134
-                                if($badge == "good") {
133
+                            foreach ($badges as $badge) {
134
+                                if ($badge == "good") {
135 135
                                     echo "<img width='70px;' height='70px;' src='https://cdn.discordapp.com/attachments/740680780740821105/740776214523936808/340juojg3h.png'>";
136 136
                                 }
137 137
                             }
@@ -143,10 +143,10 @@  discard block
 block discarded – undo
143 143
                         $stmt->bind_param("s", $username);
144 144
                         $stmt->execute();
145 145
                         $result = $stmt->get_result();
146
-                        if($result->num_rows > 0) echo('<h1>Files</h1>');
146
+                        if ($result->num_rows > 0) echo('<h1>Files</h1>');
147 147
                         
148
-                        while($row = $result->fetch_assoc()) { 
149
-                            echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [' , $row['type'] . ']</a><br>';
148
+                        while ($row = $result->fetch_assoc()) { 
149
+                            echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [', $row['type'] . ']</a><br>';
150 150
                         }?> 
151 151
                     </div><br>
152 152
                     <div id="bio" class="notegray">
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                             $stmt->execute();
161 161
                             $result = $stmt->get_result();
162 162
                             
163
-                            while($row = $result->fetch_assoc()) { ?>
163
+                            while ($row = $result->fetch_assoc()) { ?>
164 164
                                 <div class='commentRight' style='display: grid; grid-template-columns: 75% auto; padding:5px;'>
165 165
                                     <div style="word-wrap: break-word;">
166 166
                                         <small><?php echo $row['date']; ?></small>
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
             while($row = $result->fetch_assoc()) {
46 46
                 $grouptitle = $row['title'];
47 47
             }
48
-        }else{
48
+        } else{
49 49
             $grouptitle = "none";
50 50
         }
51 51
         $stmt->close();
@@ -143,7 +143,9 @@  discard block
 block discarded – undo
143 143
                         $stmt->bind_param("s", $username);
144 144
                         $stmt->execute();
145 145
                         $result = $stmt->get_result();
146
-                        if($result->num_rows > 0) echo('<h1>Files</h1>');
146
+                        if($result->num_rows > 0) {
147
+                            echo('<h1>Files</h1>');
148
+                        }
147 149
                         
148 150
                         while($row = $result->fetch_assoc()) { 
149 151
                             echo '<a href="/view?id=' . $row['id'] . '">' . $row['title'] . ' [' , $row['type'] . ']</a><br>';
Please login to merge, or discard this patch.
index.php 2 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -99,7 +99,9 @@
 block discarded – undo
99 99
                             $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC");
100 100
                             $stmt->execute();
101 101
                             $result = $stmt->get_result();
102
-                            if($result->num_rows === 0) echo('There are no users.');
102
+                            if($result->num_rows === 0) {
103
+                                echo('There are no users.');
104
+                            }
103 105
                             while($row = $result->fetch_assoc()) {
104 106
                                 $id = 1;
105 107
                                 echo "<div class='item" . $id . "'><img style='height: 8em;width: 8em;' src='/dynamic/pfp/" . getPFP($row['username'], $conn) . "'><br><a href='/view/profile?id=" . $row['id'] . "'>" . $row['username'] . "</a></div>";
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
         <div class="container">
24 24
             <br>   
25 25
             <?php
26
-            if($_SERVER['REQUEST_METHOD'] == 'POST') 
26
+            if ($_SERVER['REQUEST_METHOD'] == 'POST') 
27 27
             {
28
-                if(!isset($_SESSION['user'])){ $error = "you are not logged in"; goto skipcomment; }
29
-                if(!$_POST['comment']){ $error = "your comment cannot be blank"; goto skipcomment; }
30
-                if(strlen($_POST['comment']) > 500){ $error = "your comment must be shorter than 500 characters"; goto skipcomment; }
28
+                if (!isset($_SESSION['user'])) { $error = "you are not logged in"; goto skipcomment; }
29
+                if (!$_POST['comment']) { $error = "your comment cannot be blank"; goto skipcomment; }
30
+                if (strlen($_POST['comment']) > 500) { $error = "your comment must be shorter than 500 characters"; goto skipcomment; }
31 31
 
32 32
                 $stmt = $conn->prepare("INSERT INTO `comments` (toid, author, text) VALUES (?, ?, ?)");
33 33
                 $stmt->bind_param("sss", $_GET['id'], $_SESSION['user'], $text);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
                     <a href="/media">Featured</a><br>
59 59
                     <?php 
60
-                    if(isset($_SESSION['user'])) { echo "<a href='/home'>Manage</a><br><a href='/files'>Files</a>"; }
60
+                    if (isset($_SESSION['user'])) { echo "<a href='/home'>Manage</a><br><a href='/files'>Files</a>"; }
61 61
                     ?>
62 62
                 </div>
63 63
                 <br>
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                         $stmt = $conn->prepare("SELECT * FROM files WHERE type='review' AND status='y' ORDER BY RAND() LIMIT 1");
68 68
                         $stmt->execute();
69 69
                         $result = $stmt->get_result();
70
-                        while($row = $result->fetch_assoc()) {
70
+                        while ($row = $result->fetch_assoc()) {
71 71
                             echo "<br><img style='height: 5em;position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'>
72 72
                             <small>
73 73
                             <a href='/view?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>[" . $row['agerating'] . "] " . $row['title'] . "</a></i></span><br>
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
                         $stmt = $conn->prepare("SELECT * FROM files WHERE type='news' AND status='y' ORDER BY RAND() LIMIT 1");
84 84
                         $stmt->execute();
85 85
                         $result = $stmt->get_result();
86
-                        while($row = $result->fetch_assoc()) {
86
+                        while ($row = $result->fetch_assoc()) {
87 87
                             echo "<br><img style='height: 5em;position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'>
88 88
                             <small>
89 89
                             <a href='/view?id=" . $row['id'] . "'><span style='float:right;color: gold;'>[" . $row['agerating'] . "] <i>" . $row['title'] . "</a></i></span><br>
@@ -99,8 +99,8 @@  discard block
 block discarded – undo
99 99
                             $stmt = $conn->prepare("SELECT * FROM users ORDER BY id DESC");
100 100
                             $stmt->execute();
101 101
                             $result = $stmt->get_result();
102
-                            if($result->num_rows === 0) echo('There are no users.');
103
-                            while($row = $result->fetch_assoc()) {
102
+                            if ($result->num_rows === 0) echo('There are no users.');
103
+                            while ($row = $result->fetch_assoc()) {
104 104
                                 $id = 1;
105 105
                                 echo "<div class='item" . $id . "'><img style='height: 8em;width: 8em;' src='/dynamic/pfp/" . getPFP($row['username'], $conn) . "'><br><a href='/view/profile?id=" . $row['id'] . "'>" . $row['username'] . "</a></div>";
106 106
                                 $id = $id + 1;
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                     $stmt = $conn->prepare("SELECT * FROM files WHERE type='image' AND status='y' ORDER BY RAND() LIMIT 6");
118 118
                     $stmt->execute();
119 119
                     $result = $stmt->get_result();
120
-                    while($row = $result->fetch_assoc()) {
120
+                    while ($row = $result->fetch_assoc()) {
121 121
                         echo "<div style='display: inline-block;' class='notegray'>
122 122
                             <a href='/view?id=" . $row['id'] . "'><img style='width: 7.5em;height: 7.5em;' src='/dynamic/image/" . $row['filename'] . "'>
123 123
                             <br><center><b>" . htmlspecialchars($row['title']) . "</b><br><span style='color: gray;'>By " . $row['author'] . "</span></center>
Please login to merge, or discard this patch.
view/groups.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,8 @@
 block discarded – undo
18 18
                 $stmt = $conn->prepare("SELECT * FROM `groups` ORDER BY id DESC");
19 19
                 $stmt->execute();
20 20
                 $result = $stmt->get_result();
21
-                if($result->num_rows === 0) echo('There are no users.');
22
-                while($row = $result->fetch_assoc()) {
21
+                if ($result->num_rows === 0) echo('There are no users.');
22
+                while ($row = $result->fetch_assoc()) {
23 23
                     echo "<img style='position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'>
24 24
                     <small>
25 25
                     <a href='/view/group?id=" . $row['id'] . "'><span style='float:right;color: gold;'><i>" . $row['title'] . "</a></i></span><br>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,9 @@
 block discarded – undo
18 18
                 $stmt = $conn->prepare("SELECT * FROM `groups` ORDER BY id DESC");
19 19
                 $stmt->execute();
20 20
                 $result = $stmt->get_result();
21
-                if($result->num_rows === 0) echo('There are no users.');
21
+                if($result->num_rows === 0) {
22
+                    echo('There are no users.');
23
+                }
22 24
                 while($row = $result->fetch_assoc()) {
23 25
                     echo "<img style='position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'>
24 26
                     <small>
Please login to merge, or discard this patch.
files.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 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 ('review', ?, ?, ?, '')");
18 18
                 $stmt->bind_param("sss", $title, $description, $_SESSION['user']);
19 19
 
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
                 $stmt->execute();
35 35
                 $result = $stmt->get_result();
36 36
 
37
-                while($row = $result->fetch_assoc()) { 
37
+                while ($row = $result->fetch_assoc()) { 
38 38
                     echo "<br><img style='position: absolute;border: 1px solid white; width: 5em;' src='/dynamic/pfp/" . getPFP($row['author'], $conn) . "'>
39 39
                     <small>
40 40
                     <a href='/view?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.