Test Failed
Pull Request — main (#26)
by
unknown
03:25
created
web/public/s/mod/sidebar.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@
 block discarded – undo
40 40
 <div id="browse-side-column" class="ytg-2col ytg-last">
41 41
     <ol class="navigation-menu">
42 42
         <?php foreach($__tabs as $_tab) { 
43
-            if(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH) != $_tab->url)
44
-                $_tab->selected = true;
43
+            if(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH) != $_tab->url) {
44
+                            $_tab->selected = true;
45
+            }
45 46
             ?>
46 47
             <li class="menu-item">
47 48
                 <a class="<?php echo $_tab->selected ? true : "selected"; ?>" href="<?php echo $_tab->url; ?>">
Please login to merge, or discard this patch.
web/public/uploaded_video.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,8 +12,9 @@  discard block
 block discarded – undo
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14 14
 <?php
15
-	if(!$__video_h->video_exists($_GET['v']))
16
-		header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag.");
15
+	if(!$__video_h->video_exists($_GET['v'])) {
16
+			header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag.");
17
+	}
17 18
 
18 19
 	$_video = $__video_h->fetch_video_rid($_GET['v']); 
19 20
 	$_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
@@ -24,9 +25,10 @@  discard block
 block discarded – undo
24 25
 	$_video['title'] = htmlspecialchars($_video['title']);
25 26
 	$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
26 27
 
27
-    if($_SESSION['siteusername'] != $_video['author'])
28
-        header("Location: /");
29
-?>
28
+    if($_SESSION['siteusername'] != $_video['author']) {
29
+            header("Location: /");
30
+    }
31
+    ?>
30 32
 <?php
31 33
 	$__server->page_embeds->page_title = "SubRocks - Uploaded Video";
32 34
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
Please login to merge, or discard this patch.
web/public/watch.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -15,11 +15,13 @@  discard block
 block discarded – undo
15 15
 <?php $_video = $__video_h->fetch_video_rid($_GET['v']); ?>
16 16
 <?php $_video['comments'] = $__video_h->get_comments_from_video($_video['rid']); ?>
17 17
 <?php
18
-	if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author'])
19
-		header("Location: /");
18
+	if($_video['visibility'] == "v" && @$_SESSION['siteusername'] != $_video['author']) {
19
+			header("Location: /");
20
+	}
20 21
 
21
-	if(isset($_SESSION['siteusername']))
22
-		$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
22
+	if(isset($_SESSION['siteusername'])) {
23
+			$__video_h->check_view($_GET['v'], @$_SESSION['siteusername']);
24
+	}
23 25
 
24 26
 	$_SESSION['current_video'] = $_video['rid'];
25 27
 
@@ -739,10 +741,11 @@  discard block
 block discarded – undo
739 741
 														$stmt->execute();
740 742
 
741 743
 														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
742
-															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true))
743
-																$comment['liked'] = true;
744
-															else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false))
745
-																$comment['disliked'] = true;
744
+															if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], true)) {
745
+																															$comment['liked'] = true;
746
+															} else if($__video_h->if_comment_liked($comment['id'], $_SESSION['siteusername'], false)) {
747
+																															$comment['disliked'] = true;
748
+															}
746 749
 																
747 750
 															$comment['likes']  = $__video_h->get_comment_likes($comment['id'], true);
748 751
 															$comment['likes'] -= $__video_h->get_comment_likes($comment['id'], false);
Please login to merge, or discard this patch.
web/public/report.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,8 +8,9 @@
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10 10
 <?php
11
-if(!isset($_SESSION['siteusername']))
11
+if(!isset($_SESSION['siteusername'])) {
12 12
     header('Location: ' . $_SERVER['HTTP_REFERER'] . '&error=You have to be logged in to report videos.');
13
+}
13 14
 
14 15
 $_video = $__video_h->fetch_video_rid($_GET['v']);
15 16
 $webhookurl = $__server->discord_webhook;
Please login to merge, or discard this patch.
web/public/d/channel_update.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -174,8 +174,9 @@
 block discarded – undo
174 174
         if(!empty($_POST['solidcolor'])) {
175 175
             $__user_u->update_row($_SESSION['siteusername'], "2012_bgoption", $_POST['bgoption']);
176 176
 
177
-            if($_POST['bgoption'] == "solid")
178
-                $__user_u->update_row($_SESSION['siteusername'], "2012_bg", "");
177
+            if($_POST['bgoption'] == "solid") {
178
+                            $__user_u->update_row($_SESSION['siteusername'], "2012_bg", "");
179
+            }
179 180
 
180 181
             $__user_u->update_row($_SESSION['siteusername'], "primary_color", $_POST['solidcolor']);
181 182
         }
Please login to merge, or discard this patch.
web/public/s/mod/old_channel_customization.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -313,14 +313,15 @@
 block discarded – undo
313 313
                             for($i = 0;$i <= $countryLength; $i++)
314 314
                             {
315 315
                                 $c = $countries[$i];
316
-                                if ($c == $_user['country'])
317
-                                //country is the same as in database
316
+                                if ($c == $_user['country']) {
317
+                                                                //country is the same as in database
318 318
                                 {
319 319
                                 ?>
320
-                                <option value="<?php echo $c; ?>" selected="selected"><?php echo $c; ?></option>
321
-                                <?php
320
+                                <option value="<?php echo $c;
322 321
                                 }
323
-                                else
322
+                                ?>" selected="selected"><?php echo $c; ?></option>
323
+                                <?php
324
+                                } else
324 325
                                 {
325 326
                                 ?>
326 327
                                 <option value="<?php echo $c;?>"><?php echo $c; ?></option>
Please login to merge, or discard this patch.
web/public/channel.php 1 patch
Braces   +18 added lines, -13 removed lines patch added patch discarded remove patch
@@ -12,11 +12,13 @@  discard block
 block discarded – undo
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14 14
 <?php
15
-	if(isset($_SESSION['siteusername']))
16
-	    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
15
+	if(isset($_SESSION['siteusername'])) {
16
+		    $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']);
17
+	}
17 18
 
18
-    if(!$__user_h->user_exists($_GET['n']))
19
-        header("Location: /?userdoesntexist");
19
+    if(!$__user_h->user_exists($_GET['n'])) {
20
+            header("Location: /?userdoesntexist");
21
+    }
20 22
 
21 23
     $_user = $__user_h->fetch_user_username($_GET['n']);
22 24
 
@@ -39,10 +41,11 @@  discard block
 block discarded – undo
39 41
     
40 42
         if (
41 43
               ctype_xdigit($colorCode) &&
42
-              (strlen($colorCode) == 6 || strlen($colorCode) == 3))
43
-                   return true;
44
-    
45
-        else return false;
44
+              (strlen($colorCode) == 6 || strlen($colorCode) == 3)) {
45
+                           return true;
46
+        } else {
47
+            return false;
48
+        }
46 49
     }
47 50
 
48 51
     $_user['subscribers'] = $__user_h->fetch_subs_count($_user['username']);
@@ -74,8 +77,9 @@  discard block
 block discarded – undo
74 77
     if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; }
75 78
     if(!check_valid_colorhex($_user['2012_bgcolor']) && strlen($_user['2012_bgcolor']) != 6) { $_user['2012_bgcolor'] = ""; }
76 79
 
77
-	if(isset($_SESSION['siteusername']))
78
-    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
80
+	if(isset($_SESSION['siteusername'])) {
81
+	    	$__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']);
82
+	}
79 83
 
80 84
     if($_SERVER['REQUEST_METHOD'] == 'POST') {
81 85
         $error = array();
@@ -188,8 +192,9 @@  discard block
 block discarded – undo
188 192
 					<div class="channel_customization"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div>
189 193
 				<?php } ?>
190 194
 				<?php
191
-					if(empty(trim($_user['bio'])))
192
-						$_user['bio'] = "This user has no description.";
195
+					if(empty(trim($_user['bio']))) {
196
+											$_user['bio'] = "This user has no description.";
197
+					}
193 198
 				?>
194 199
 				<div id="content">
195 200
 					<div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid">
@@ -272,7 +277,7 @@  discard block
 block discarded – undo
272 277
 												<div class="header-stats">
273 278
 													<div class="stat-entry">
274 279
 														<span class="stat-value"><?php echo $_user['subscribers']; ?></span>
275
-														<span class="stat-name"><?php if($_user['subscribers'] == 1){ ?>subscriber<?php }else{ ?>subscribers<?php } ?></span>
280
+														<span class="stat-name"><?php if($_user['subscribers'] == 1){ ?>subscriber<?php } else{ ?>subscribers<?php } ?></span>
276 281
 													</div>
277 282
 													<div class="stat-entry">
278 283
 														<span class="stat-value"><?php echo $_user['views']; ?></span>
Please login to merge, or discard this patch.