Test Failed
Push — main ( d9df25...7cc2e0 )
by chief
07:27
created
web/public/watch.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -10,19 +10,19 @@  discard block
 block discarded – undo
10 10
 <?php $__user_u = new user_update($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13
-<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
13
+<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
14 14
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
15 15
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
16 16
 <?php
17
-    if($_SERVER['REQUEST_METHOD'] == 'POST') {
17
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
18 18
         $error = array();
19 19
 
20
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
21
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
22
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
23
-        if($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; }
20
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
21
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
22
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
23
+        if ($__user_h->if_cooldown($_SESSION['siteusername'])) { $error['message'] = "You are on a cooldown! Wait for a minute before posting another comment."; $error['status'] = true; }
24 24
 
25
-        if(!isset($error['message'])) {
25
+        if (!isset($error['message'])) {
26 26
 			$text = $_POST['comment'];
27 27
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
28 28
             $stmt->bindParam(":v", $_GET['v']);
@@ -53,17 +53,17 @@  discard block
 block discarded – undo
53 53
 			if (window.yt.timing) {yt.timing.tick("ct");}    
54 54
 		</script>
55 55
 		<?php
56
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
56
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
57 57
 			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
58 58
 
59
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
60
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
59
+			$_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4);
60
+			$_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5);
61 61
 
62
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
62
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
63 63
 				$_video['likeswidth'] = 50;
64 64
 				$_video['dislikeswidth'] = 50;
65 65
 			} else {
66
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
66
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
67 67
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
68 68
 			}
69 69
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 									</div>
95 95
 									<div id="instream_google_companion_ad_div"></div>
96 96
 								</div>
97
-								<?php if(@$_SESSION['siteusername'] == $_video['author']) { ?>
97
+								<?php if (@$_SESSION['siteusername'] == $_video['author']) { ?>
98 98
 									<div id="watch-owner-container">
99 99
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
100 100
 											<ul class="yt-nav-aside">
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 											title="" 
130 130
 											id="subscribe-button"
131 131
 											type="button" 
132
-											class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
132
+											class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
133 133
 											role="button">
134 134
 											<span class="yt-uix-button-icon-wrapper">
135 135
 												<img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="">
@@ -332,7 +332,7 @@  discard block
 block discarded – undo
332 332
 												$stmt->execute();
333 333
 											?>
334 334
 
335
-											<?php if($stmt->rowCount() != 0) { ?>
335
+											<?php if ($stmt->rowCount() != 0) { ?>
336 336
 												<div class="comments-section">
337 337
 													<a class="comments-section-see-all" href="/video_response_view_all?v=rLHU-_OhT8g">
338 338
 													see all
@@ -340,8 +340,8 @@  discard block
 block discarded – undo
340 340
 													<h4>Video Responses</h4>
341 341
 													<ul class="video-list">
342 342
 													<?php 
343
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
344
-															if($__video_h->video_exists($video['video'])) { 
343
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
344
+															if ($__video_h->video_exists($video['video'])) { 
345 345
 																$video = $__video_h->fetch_video_rid($video['video']);
346 346
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
347 347
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -372,19 +372,19 @@  discard block
 block discarded – undo
372 372
 														</h4>
373 373
 													</div>
374 374
 												</div>
375
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
375
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
376 376
 													<div class="comments-post-container clearfix">
377 377
 														<div class="comments-post-alert">
378 378
 															<a href="/sign_in">Sign In</a> or <a href="/sign_up">Sign Up</a><span class="comments-post-form-rollover-text"> now to post a comment!</span>
379 379
 														</div>
380 380
 													</div>
381
-												<?php } else if($_video['commenting'] == "d") { ?>
381
+												<?php } else if ($_video['commenting'] == "d") { ?>
382 382
 													<div class="comments-post-container clearfix">
383 383
 														<div class="comments-post-alert">
384 384
 															This video has comemnting disabled!
385 385
 														</div>
386 386
 													</div>
387
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
387
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
388 388
 													<div class="comments-post-container clearfix">
389 389
 														<div class="comments-post-alert">
390 390
 															This user has blocked you!
@@ -438,15 +438,15 @@  discard block
 block discarded – undo
438 438
 														$stmt->execute();
439 439
 
440 440
 														$number_of_result = $stmt->rowCount();
441
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
441
+														$number_of_page = ceil($number_of_result/$results_per_page);  
442 442
 
443
-														if (!isset ($_GET['page']) ) {  
443
+														if (!isset ($_GET['page'])) {  
444 444
 															$page = 1;  
445 445
 														} else {  
446
-															$page = (int)$_GET['page'];  
446
+															$page = (int) $_GET['page'];  
447 447
 														}  
448 448
 
449
-														$page_first_result = ($page - 1) * $results_per_page;  
449
+														$page_first_result = ($page - 1)*$results_per_page;  
450 450
 
451 451
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
452 452
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
 														$stmt->bindParam(":pper", $results_per_page);
455 455
 														$stmt->execute();
456 456
 
457
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
457
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
458 458
 													?>
459 459
 
460 460
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0">
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 												<?php
535 535
 													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
536 536
 													$stmt->execute();
537
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
537
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
538 538
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
539 539
 														$video['duration'] = $__time_h->timestamp($video['duration']);
540 540
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.
web/public/edit_video.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 <?php $__user_h = new user_helper($__db); ?>
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
14 14
 <?php $_video = $__video_h->fetch_video_rid($_GET['id']); ?>
15 15
 <!DOCTYPE html>
16 16
 <html dir="ltr">
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                                         <b>Category</b> <br>
175 175
                                         <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default">
176 176
                                             <?php $categories = ["None", "Film & Animation", "Autos & Vehicles", "Music", "Pets & Animals", "Sports", "Travel & Events", "Gaming", "People & Blogs", "Comedy", "Entertainment", "News & Politics", "Howto & Style", "Education", "Science & Technology", "Nonprofits & Activism"]; ?>
177
-                                            <?php foreach($categories as $categoryTag) { ?>
177
+                                            <?php foreach ($categories as $categoryTag) { ?>
178 178
                                                 <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option>
179 179
                                             <?php } ?>
180 180
                                         </select><br><br>
Please login to merge, or discard this patch.
web/public/d/login.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 <?php $__db_h = new db_helper(); ?>
10 10
 <?php $__time_h = new time_helper(); ?>
11 11
 <?php
12
-    if($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
12
+    if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
13 13
         $request = (object) [
14 14
             "username" => $_POST['username'],
15 15
             "password" => $_POST['password'],
@@ -26,19 +26,19 @@  discard block
 block discarded – undo
26 26
         $stmt->bindParam(":username", $request->username);
27 27
         $stmt->execute();
28 28
 
29
-        if(!$stmt->rowCount()){ 
29
+        if (!$stmt->rowCount()) { 
30 30
             { $request->error->message = "Incorrect username or password!"; $request->error->status = ""; } }
31 31
 
32 32
         $row = $stmt->fetch(PDO::FETCH_ASSOC);
33
-        if(!isset($row['password'])) 
33
+        if (!isset($row['password'])) 
34 34
             { $request->error->message = "Incorrect username or password!"; $request->error->status = ""; } 
35 35
         else 
36 36
             { $request->returned_password = $row['password']; }
37 37
 
38
-        if(!password_verify($request->password, $request->returned_password)) 
38
+        if (!password_verify($request->password, $request->returned_password)) 
39 39
             { $request->error->message = "Incorrect username or password!"; $request->error->status = ""; }
40 40
         
41
-        if($request->error->status == "OK") {
41
+        if ($request->error->status == "OK") {
42 42
             $_SESSION['siteusername'] = $request->username;
43 43
             header("Location: /");
44 44
         } else {
Please login to merge, or discard this patch.
web/public/d/upload.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         'target_upload_name' => md5_file($_FILES["video_file"]["tmp_name"]) . ".mp4",
37 37
     ];
38 38
 
39
-    if(move_uploaded_file(
39
+    if (move_uploaded_file(
40 40
         $_FILES['video_file']['tmp_name'], 
41 41
         "dynamic/temp/" . $video_properties->video_rid . $video_validation->video_file_type
42 42
     )) {
Please login to merge, or discard this patch.
web/public/d/edit_video.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 <?php $__time_h = new time_helper(); ?>
15 15
 <?php
16 16
     $_video = $__video_h->fetch_video_rid($_GET['v']);
17
-    if($_video['author'] != @$_SESSION['siteusername']) {
17
+    if ($_video['author'] != @$_SESSION['siteusername']) {
18 18
         die();
19 19
     }
20 20
 
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
     $__video_u->update_row($_GET['v'], "thumbnail", $request->thumbnail);
40 40
     $__video_u->update_row($_GET['v'], "category", $request->category);
41 41
 
42
-    if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['thumbnail']) {
43
-        if(!empty($_FILES["thumbnail"]["name"])) {
42
+    if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['thumbnail']) {
43
+        if (!empty($_FILES["thumbnail"]["name"])) {
44 44
             $target_dir = "dynamic/thumbs/";
45 45
             $imageFileType = strtolower(pathinfo($_FILES["thumbnail"]["name"], PATHINFO_EXTENSION));
46 46
             $target_name = md5_file($_FILES["thumbnail"]["tmp_name"]) . "." . $imageFileType;
@@ -50,8 +50,8 @@  discard block
 block discarded – undo
50 50
             $uploadOk = true;
51 51
             $movedFile = false;
52 52
     
53
-            if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
54
-                && $imageFileType != "gif" ) {
53
+            if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
54
+                && $imageFileType != "gif") {
55 55
                 $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
56 56
                 $uploadOk = false;
57 57
                 goto skip;
Please login to merge, or discard this patch.
web/public/d/signup.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 <?php $__db_h = new db_helper(); ?>
10 10
 <?php $__time_h = new time_helper(); ?>
11 11
 <?php
12
-    if($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
12
+    if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
13 13
         $request = (object) [
14 14
             "username" => $_POST['username'],
15 15
             "password" => $_POST['password'],
@@ -23,25 +23,25 @@  discard block
 block discarded – undo
23 23
         ]; 
24 24
 
25 25
         if (!filter_var($request->email, FILTER_VALIDATE_EMAIL)) 
26
-            { $request->error->message = "Your email is invalid!"; $request->error->status = "";  }
27
-        if(strlen($request->username) > 21) 
26
+            { $request->error->message = "Your email is invalid!"; $request->error->status = ""; }
27
+        if (strlen($request->username) > 21) 
28 28
             { $request->error->message = "Your username must be shorter than 21 characters."; $request->error->status = ""; }
29
-        if(strlen($request->password) < 8) 
29
+        if (strlen($request->password) < 8) 
30 30
             { $request->error->message = "Your password must at least be 8 characters long."; $request->error->status = ""; }
31
-        if(!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) 
31
+        if (!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) 
32 32
             { $request->error->message = "Include numbers and letters in your password!"; $request->error->status = ""; }
33
-        if(!preg_match('/^\S+\w\S{1,}/', $request->username)) 
33
+        if (!preg_match('/^\S+\w\S{1,}/', $request->username)) 
34 34
             { $request->error->message = "Your username cannot contain any special characters!"; $request->error->status = ""; }
35
-        if(empty(trim($request->username))) 
35
+        if (empty(trim($request->username))) 
36 36
             { $request->error->message = "Your username cannot be empty!"; $request->error->status = ""; }
37 37
         
38 38
         $stmt = $__db->prepare("SELECT username FROM users WHERE username = :username");
39 39
         $stmt->bindParam(":username", $username);
40 40
         $stmt->execute();
41
-        if($stmt->rowCount()) 
41
+        if ($stmt->rowCount()) 
42 42
             { $request->error->message = "There's already a user with that same username!"; $request->error->status = ""; }
43 43
         
44
-        if($request->error->status == "OK") {
44
+        if ($request->error->status == "OK") {
45 45
             $stmt = $__db->prepare("INSERT INTO users (username, email, password) VALUES (:username, :email, :password)");
46 46
             $stmt->bindParam(":username", $request->username);
47 47
             $stmt->bindParam(":email", $request->email);
Please login to merge, or discard this patch.
web/public/d/channel_update.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -17,14 +17,14 @@  discard block
 block discarded – undo
17 17
         return preg_replace('/[^A-Za-z0-9\-]/', '', $string); // Removes special chars.
18 18
     }
19 19
 
20
-        if(isset($_POST['layout'])) { 
20
+        if (isset($_POST['layout'])) { 
21 21
             $stmt = $__db->prepare("UPDATE users SET layout = :layout WHERE username = :username");
22 22
             $stmt->bindParam(":layout", $_POST['layout']);
23 23
             $stmt->bindParam(":username", $_SESSION['siteusername']);
24 24
             $stmt->execute();
25 25
         }
26 26
 
27
-        if(isset($_POST['left'])) {
27
+        if (isset($_POST['left'])) {
28 28
             $clean = $_POST['left'];
29 29
             $stmt = $__db->prepare("UPDATE users SET 2009_user_left = :clean WHERE username = :username");
30 30
             $stmt->bindParam(":clean", $clean);
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
             $stmt->execute();
33 33
         }
34 34
 
35
-        if(isset($_POST['right'])) {
35
+        if (isset($_POST['right'])) {
36 36
             $clean = $_POST['right'];
37 37
             $stmt = $__db->prepare("UPDATE users SET 2009_user_right = :clean WHERE username = :username");
38 38
             $stmt->bindParam(":clean", $clean);
@@ -41,8 +41,8 @@  discard block
 block discarded – undo
41 41
         }
42 42
 
43 43
 
44
-        if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['pfpset']) {
45
-            if(!empty($_FILES["pfpset"]["name"])) {
44
+        if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['pfpset']) {
45
+            if (!empty($_FILES["pfpset"]["name"])) {
46 46
                 $target_dir = "dynamic/pfp/";
47 47
                 $imageFileType = strtolower(pathinfo($_FILES["pfpset"]["name"], PATHINFO_EXTENSION));
48 48
                 $target_name = md5_file($_FILES["pfpset"]["tmp_name"]) . "." . $imageFileType;
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
                 $uploadOk = true;
53 53
                 $movedFile = false;
54 54
         
55
-                if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
56
-                    && $imageFileType != "gif" ) {
55
+                if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
56
+                    && $imageFileType != "gif") {
57 57
                     $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
58 58
                     $uploadOk = false;
59 59
                     goto skip;
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
                     }
77 77
                 }
78 78
             }
79
-        } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['backgroundbgset']) {
80
-            if(!empty($_FILES["backgroundbgset"]["name"])) {
79
+        } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['backgroundbgset']) {
80
+            if (!empty($_FILES["backgroundbgset"]["name"])) {
81 81
                 $target_dir = "dynamic/banners/";
82 82
                 $imageFileType = strtolower(pathinfo($_FILES["backgroundbgset"]["name"], PATHINFO_EXTENSION));
83 83
                 $target_name = md5_file($_FILES["backgroundbgset"]["tmp_name"]) . "." . $imageFileType;
@@ -87,14 +87,14 @@  discard block
 block discarded – undo
87 87
                 $uploadOk = true;
88 88
                 $movedFile = false;
89 89
     
90
-                if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
91
-                    && $imageFileType != "gif" ) {
90
+                if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
91
+                    && $imageFileType != "gif") {
92 92
                     $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
93 93
                     $uploadOk = false;
94 94
                     goto skip;
95 95
                 }
96 96
     
97
-                if($uploadOk) { 
97
+                if ($uploadOk) { 
98 98
                     if (file_exists($target_file)) {
99 99
                         $movedFile = true;
100 100
                     } else {
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
                     }
111 111
                 }
112 112
             }
113
-        } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_POST['bannerset']) {
114
-            if(!empty($_FILES["file"]["name"])) {
113
+        } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_POST['bannerset']) {
114
+            if (!empty($_FILES["file"]["name"])) {
115 115
                 $target_dir = "dynamic/banners/";
116 116
                 $imageFileType = strtolower(pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION));
117 117
                 $target_name = md5_file($_FILES["file"]["tmp_name"]) . "." . $imageFileType;
@@ -121,14 +121,14 @@  discard block
 block discarded – undo
121 121
                 $uploadOk = true;
122 122
                 $movedFile = false;
123 123
     
124
-                if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
125
-                    && $imageFileType != "gif" ) {
124
+                if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
125
+                    && $imageFileType != "gif") {
126 126
                     $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
127 127
                     $uploadOk = false;
128 128
                     goto skip;
129 129
                 }
130 130
     
131
-                if($uploadOk) { 
131
+                if ($uploadOk) { 
132 132
                     if (file_exists($target_file)) {
133 133
                         $movedFile = true;
134 134
                     } else {
@@ -144,8 +144,8 @@  discard block
 block discarded – undo
144 144
                     }
145 145
                 } 
146 146
             }
147
-        } else if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['videopagebanner']) {
148
-            if(!empty($_FILES["videopagebanner"]["name"])) {
147
+        } else if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['videopagebanner']) {
148
+            if (!empty($_FILES["videopagebanner"]["name"])) {
149 149
                 $target_dir = "dynamic/subscribe/";
150 150
                 $imageFileType = strtolower(pathinfo($_FILES["videopagebanner"]["name"], PATHINFO_EXTENSION));
151 151
                 $target_name = md5_file($_FILES["videopagebanner"]["tmp_name"]) . "." . $imageFileType;
@@ -155,14 +155,14 @@  discard block
 block discarded – undo
155 155
                 $uploadOk = true;
156 156
                 $movedFile = false;
157 157
     
158
-                if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
159
-                    && $imageFileType != "gif" ) {
158
+                if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
159
+                    && $imageFileType != "gif") {
160 160
                     $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
161 161
                     $uploadOk = false;
162 162
                     goto skip;
163 163
                 }
164 164
     
165
-                if($uploadOk) { 
165
+                if ($uploadOk) { 
166 166
                     if (file_exists($target_file)) {
167 167
                         $movedFile = true;
168 168
                     } else {
@@ -180,75 +180,75 @@  discard block
 block discarded – undo
180 180
             }
181 181
         }
182 182
 
183
-        if(!empty($_POST['bio'])) { 
183
+        if (!empty($_POST['bio'])) { 
184 184
             $__user_u->update_row($_SESSION['siteusername'], "bio", $_POST['bio']);
185 185
         }
186 186
 
187
-        if(!empty($_POST['videoid'])) { 
187
+        if (!empty($_POST['videoid'])) { 
188 188
             $__user_u->update_row($_SESSION['siteusername'], "featured_channels", $_POST['videoid']);
189 189
         } // duplicate?
190 190
     
191
-        if(!empty($_POST['css'])) {
191
+        if (!empty($_POST['css'])) {
192 192
             $__user_u->update_row($_SESSION['siteusername'], "css", $_POST['css']);
193 193
         }
194 194
 
195
-        if(!empty($_POST['videoid'])) {
195
+        if (!empty($_POST['videoid'])) {
196 196
             $__user_u->update_row($_SESSION['siteusername'], "featured", $_POST['videoid']);
197 197
         }
198 198
 
199
-        if(!empty($_POST['solidcolor'])) {
199
+        if (!empty($_POST['solidcolor'])) {
200 200
             $__user_u->update_row($_SESSION['siteusername'], "primary_color", $_POST['solidcolor']);
201 201
         }
202 202
 
203
-        if(!empty($_POST['transparency'])) {
203
+        if (!empty($_POST['transparency'])) {
204 204
             $__user_u->update_row($_SESSION['siteusername'], "transparency", $_POST['transparency']);
205 205
         }
206 206
 
207
-        if(!empty($_POST['genre'])) {
207
+        if (!empty($_POST['genre'])) {
208 208
             $__user_u->update_row($_SESSION['siteusername'], "genre", $_POST['genre']);
209 209
         }
210 210
 
211
-        if(!empty($_POST['bordercolor'])) {
211
+        if (!empty($_POST['bordercolor'])) {
212 212
             $__user_u->update_row($_SESSION['siteusername'], "border_color", $_POST['bordercolor']);
213 213
         }
214 214
 
215
-        if(!empty($_POST['country'])) {
215
+        if (!empty($_POST['country'])) {
216 216
             $__user_u->update_row($_SESSION['siteusername'], "country", $_POST['country']);
217 217
         } // duplicate?
218 218
 
219
-        if(!empty($_POST['header'])) {
219
+        if (!empty($_POST['header'])) {
220 220
             $__user_u->update_row($_SESSION['siteusername'], "custom_header", $_POST['header']);
221 221
         }
222 222
 
223
-        if(!empty($_POST['channels'])) {
223
+        if (!empty($_POST['channels'])) {
224 224
             $__user_u->update_row($_SESSION['siteusername'], "featured_channels", $_POST['channels']);
225 225
         } // duplicate?
226 226
 
227
-        if(!empty($_POST['customtext'])) {
227
+        if (!empty($_POST['customtext'])) {
228 228
             $__user_u->update_row($_SESSION['siteusername'], "custom_text", $_POST['customtext']);
229 229
         }
230 230
 
231
-        if(!empty($_POST['country'])) {
231
+        if (!empty($_POST['country'])) {
232 232
             $__user_u->update_row($_SESSION['siteusername'], "custom_text", $_POST['country']);
233 233
         } // duplicate?
234 234
 
235
-        if(!empty($_POST['website'])) {
235
+        if (!empty($_POST['website'])) {
236 236
             $__user_u->update_row($_SESSION['siteusername'], "website", $_POST['website']);
237 237
         }
238 238
     
239
-        if(!empty($_POST['channelboxcolor'])) {
239
+        if (!empty($_POST['channelboxcolor'])) {
240 240
             $__user_u->update_row($_SESSION['siteusername'], "secondary_color", $_POST['channelboxcolor']);
241 241
         }
242 242
 
243
-        if(!empty($_POST['backgroundcolor'])) {
243
+        if (!empty($_POST['backgroundcolor'])) {
244 244
             $__user_u->update_row($_SESSION['siteusername'], "third_color", $_POST['backgroundcolor']);
245 245
         }
246 246
 
247
-        if(!empty($_POST['textmaincolor'])) {
247
+        if (!empty($_POST['textmaincolor'])) {
248 248
             $__user_u->update_row($_SESSION['siteusername'], "primary_color_text", $_POST['textmaincolor']);
249 249
         }
250 250
 
251
-    if(!empty($_POST['bgoptionset'])) {
251
+    if (!empty($_POST['bgoptionset'])) {
252 252
         $bgoption = $_POST['bgoption'];
253 253
         $bgcolor = $_POST['solidcolor'];
254 254
         $default = "default.png";
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         
258 258
         $__user_u->update_row($_SESSION['siteusername'], "2009_bgcolor", $bgcolor);
259 259
 
260
-        if($bgoption == "solid") {
260
+        if ($bgoption == "solid") {
261 261
             $__user_u->update_row($_SESSION['siteusername'], "2009_bg", $default);
262 262
         }
263 263
     }
Please login to merge, or discard this patch.
web/public/s/classes/config.inc.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,15 +21,15 @@  discard block
 block discarded – undo
21 21
             "db_connected" => false,
22 22
         ], 
23 23
 
24
-        "video_properties" => (object) [ "status" => "unloaded" ],
25
-        "user_properties"  => (object) [ "status" => "unloaded" ],
26
-        "group_properties" => (object) [ "status" => "unloaded" ],
27
-        "forum_properties" => (object) [ "status" => "unloaded" ],
24
+        "video_properties" => (object) ["status" => "unloaded"],
25
+        "user_properties"  => (object) ["status" => "unloaded"],
26
+        "group_properties" => (object) ["status" => "unloaded"],
27
+        "forum_properties" => (object) ["status" => "unloaded"],
28 28
     ];
29 29
 
30 30
     try
31 31
     {
32
-        $__db = new PDO("mysql:host=".$__server->db_properties->db_host.";dbname=".$__server->db_properties->db_database.";charset=utf8mb4",
32
+        $__db = new PDO("mysql:host=" . $__server->db_properties->db_host . ";dbname=" . $__server->db_properties->db_database . ";charset=utf8mb4",
33 33
             $__server->db_properties->db_user,
34 34
             $__server->db_properties->db_password,
35 35
             [
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         );
40 40
         $__server->db_properties->db_connected = true;
41 41
     }
42
-    catch(PDOException $e)
42
+    catch (PDOException $e)
43 43
     {
44 44
         $__server->db_properties->db_connected = false;
45 45
         die($e);
Please login to merge, or discard this patch.
web/public/s/classes/user_helper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 class user_helper {
12 12
     public $__db;
13 13
 
14
-	public function __construct($conn){
14
+	public function __construct($conn) {
15 15
         $this->__db = $conn;
16 16
 	}
17 17
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
         $stmt = $this->__db->prepare("SELECT pfp FROM users WHERE username = :username");
20 20
         $stmt->bindParam(":username", $username);
21 21
         $stmt->execute();
22
-        while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
22
+        while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
23 23
             $pfp = $row['pfp'];
24 24
         } // why the while statement? just remove it (i cant be bothered to)
25 25
 
Please login to merge, or discard this patch.