Test Failed
Push — main ( bc8e2c...7e4e6e )
by chief
03:43 queued 14s
created
web/public/get/delete_user_admin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@
 block discarded – undo
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14
-    if(!isset($_SESSION['siteusername'])) { die(); }
15
-    if(!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
14
+    if (!isset($_SESSION['siteusername'])) { die(); }
15
+    if (!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
16 16
 
17 17
     $request = (object) [
18 18
         "username" => $_GET['v'],
Please login to merge, or discard this patch.
web/public/get/delete_video_admin.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@
 block discarded – undo
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14
-    if(!isset($_SESSION['siteusername'])) { die(); }
15
-    if(!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
14
+    if (!isset($_SESSION['siteusername'])) { die(); }
15
+    if (!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
16 16
 
17 17
     $request = (object) [
18 18
         "video" => $_GET['v'],
Please login to merge, or discard this patch.
web/public/s/mod/sidebar_inbox.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,8 +35,8 @@
 block discarded – undo
35 35
     </a>
36 36
 </div>
37 37
     <ol class="navigation-menu">
38
-        <?php foreach($__tabs as $_tab) { 
39
-            if($_SERVER['REQUEST_URI'] != $_tab->url)
38
+        <?php foreach ($__tabs as $_tab) { 
39
+            if ($_SERVER['REQUEST_URI'] != $_tab->url)
40 40
                 $_tab->selected = true;
41 41
             ?>
42 42
             <li class="menu-item">
Please login to merge, or discard this patch.
web/public/admin/index.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -9,8 +9,8 @@  discard block
 block discarded – undo
9 9
 <?php $__user_u = new user_update($__db); ?>
10 10
 <?php $__db_h = new db_helper(); ?>
11 11
 <?php $__time_h = new time_helper(); ?>
12
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
-<?php if(!$__user_h->if_admin($_SESSION['siteusername'])) { header("Location: /"); } ?>
12
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
13
+<?php if (!$__user_h->if_admin($_SESSION['siteusername'])) { header("Location: /"); } ?>
14 14
 <?php
15 15
 	$__server->page_embeds->page_title = "SubRocks - Admin Panel";
16 16
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		$dif['idle'] = $info2[3] - $info1[3]; 
31 31
 		$total = array_sum($dif); 
32 32
 		$cpu = array(); 
33
-		foreach($dif as $x=>$y) $cpu[$x] = round($y / $total * 100, 1);
33
+		foreach ($dif as $x=>$y) $cpu[$x] = round($y/$total*100, 1);
34 34
 
35 35
 		return $cpu;
36 36
 	}
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
 		foreach ($hexCode as & $color) {
48 48
 			$adjustableLimit = $adjustPercent < 0 ? $color : 255 - $color;
49
-			$adjustAmount = ceil($adjustableLimit * $adjustPercent);
49
+			$adjustAmount = ceil($adjustableLimit*$adjustPercent);
50 50
 
51 51
 			$color = str_pad(dechex($color + $adjustAmount), 2, '0', STR_PAD_LEFT);
52 52
 		}
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 
57 57
 	function get_server_memory_usage() {
58 58
 		$free = shell_exec('free');
59
-		$free = (string)trim($free);
59
+		$free = (string) trim($free);
60 60
 		$free_arr = explode("\n", $free);
61 61
 		$mem = explode(" ", $free_arr[1]);
62 62
 		$mem = array_filter($mem);
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 											CPU Idle Usage: 
275 275
 												<b style="float:right;color:<?php echo adjustBrightness("#FF0000", $server['idle']); ?>">
276 276
 													<?php echo $server['idle']; ?>%</b><br>
277
-											RAM Usage: <b style="float:right;"><?php echo round(get_server_memory_usage(), 3)	; ?> megabytes</b>
277
+											RAM Usage: <b style="float:right;"><?php echo round(get_server_memory_usage(), 3); ?> megabytes</b>
278 278
 										</div>
279 279
 										<div style="width: 200px;display:inline-block;margin-right:20px;vertical-align: top;margin-left: 22px;">
280 280
 											<?php $server = get_server_array_stats(); ?>
Please login to merge, or discard this patch.
web/public/s/mod/channel_feed.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
                                                                         $stmt->bindParam(":comment_username", $_user['username']);
48 48
 																		$stmt->bindParam(":videos_username", $_user['username']);
49 49
                                                                         $stmt->execute();
50
-																		if($stmt->rowCount() == 0) { echo "<br><span style='color:grey;font-size:11px;'>This user has not done anything yet.</span>"; }
51
-                                                                        while($content = $stmt->fetch(PDO::FETCH_ASSOC)) { 
52
-																			if((int)$content['id']) {
50
+																		if ($stmt->rowCount() == 0) { echo "<br><span style='color:grey;font-size:11px;'>This user has not done anything yet.</span>"; }
51
+                                                                        while ($content = $stmt->fetch(PDO::FETCH_ASSOC)) { 
52
+																			if ((int) $content['id']) {
53 53
 																				$content = $__video_h->fetch_comment_id($content['id']);
54 54
 																				$content['video'] = $__video_h->fetch_video_rid($content['toid']);
55 55
 																				$content['type'] = "comment";
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 																				$content['type'] = "video";
59 59
 																			}
60 60
 
61
-																			if($content['type'] == "video") {
61
+																			if ($content['type'] == "video") {
62 62
                                                                     ?>
63 63
                                                                     <div class="feed-item-container" data-channel-key="UCc6W7efUSkd9YYoxOnctlFg">
64 64
                                                                         <a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>">  <span class="feed-item-author">
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                                                                         </div>
131 131
                                                                     </div>
132 132
                                                                     <?php } else { 
133
-																		if($__video_h->video_exists($content['video']['rid'])) { ?>
133
+																		if ($__video_h->video_exists($content['video']['rid'])) { ?>
134 134
 																	<div class="feed-item-container" data-channel-key="UCXf1X2u5gsmuqcuTQlpOGhw">
135 135
 																		<a href="/user/<?php echo htmlspecialchars($content['author']); ?>?feature=plcp" class="feed-author-bubble " title="<?php echo htmlspecialchars($content['author']); ?>">  <span class="feed-item-author">
136 136
 																		<span class="video-thumb ux-thumb yt-thumb-square-28 "><span class="yt-thumb-clip"><span class="yt-thumb-clip-inner"><img src="http://s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="<?php echo htmlspecialchars($content['author']); ?>" data-thumb="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($content['author']); ?>" width="28"><span class="vertical-align"></span></span></span></span>
@@ -236,7 +236,7 @@  discard block
 block discarded – undo
236 236
 														</div>
237 237
 														<hr class="yt-horizontal-rule ">
238 238
 													</div>
239
-													<?php if(!empty($_user['website'])) { ?>
239
+													<?php if (!empty($_user['website'])) { ?>
240 240
 														<div class="user-profile-item">
241 241
 															<div class="yt-c3-profile-custom-url field-container ">
242 242
 																<a href="<?php echo addhttp(htmlspecialchars($_user['website'])); ?>" rel="me nofollow" target="_blank" title="<?php echo htmlspecialchars($_user['website']); ?>" class="yt-uix-redirect-link">
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
 															<h5>Country</h5>
286 286
 															<span class="value"><?php echo htmlspecialchars($_user['country']); ?></span>
287 287
 														</div>
288
-														<?php if($_user['genre'] != "none") { ?>
288
+														<?php if ($_user['genre'] != "none") { ?>
289 289
 															<div class="user-profile-item ">
290 290
 																<h5>Channel Genre</h5>
291 291
 																<span class="value"><?php echo htmlspecialchars(ucfirst($_user['genre'])); ?></span>
@@ -297,16 +297,16 @@  discard block
 block discarded – undo
297 297
 											</div>
298 298
 											<div class="channel-module other-channels yt-uix-c3-module-container other-channels-compact">
299 299
 												<?php $_user['featured_channels'] = explode(",", $_user['featured_channels']); ?>
300
-												<?php if(count($_user['featured_channels']) != 0) { ?>
300
+												<?php if (count($_user['featured_channels']) != 0) { ?>
301 301
 												<div class="module-view other-channels-view">
302
-													<h2 <?php if(@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
303
-													<?php if(@$_SESSION['siteusername'] == $_user['username']) { 
302
+													<h2 <?php if (@$_SESSION['siteusername'] == $_user['username']) { ?>style="display: inline-block;position: relative;bottom: 10px;"<?php } ?>>Featured Channels</h2> 
303
+													<?php if (@$_SESSION['siteusername'] == $_user['username']) { 
304 304
 														echo "<a href='#' style='float:right;font-size:11px;color:black;' onclick=';open_featured_channels();return false;'>edit</a>"; 
305 305
 													} ?>
306 306
 													<ul class="channel-summary-list ">
307 307
 														<?php 
308
-															foreach($_user['featured_channels'] as $user) {
309
-																if($__user_h->user_exists($user)) {
308
+															foreach ($_user['featured_channels'] as $user) {
309
+																if ($__user_h->user_exists($user)) {
310 310
 														?>
311 311
 															<li class="yt-tile-visible yt-uix-tile">
312 312
 																<div class="channel-summary clearfix channel-summary-compact">
@@ -335,13 +335,13 @@  discard block
 block discarded – undo
335 335
 												$stmt->bindParam(":search", $_user['username']);
336 336
 												$stmt->execute();
337 337
 
338
-												if($stmt->rowCount() != 0) {
338
+												if ($stmt->rowCount() != 0) {
339 339
 											?>
340 340
 												<div class="playlists-narrow channel-module yt-uix-c3-module-container">
341 341
 													<div class="module-view gh-featured">
342 342
 														<h2>Featured Playlists</h2>     
343 343
 														<?php
344
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
344
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
345 345
 															$playlist['videos'] = json_decode($playlist['videos']);
346 346
 														?> 
347 347
 															<div class="playlist yt-tile-visible yt-uix-tile">
Please login to merge, or discard this patch.
web/public/api/get_user_info.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,8 +14,8 @@  discard block
 block discarded – undo
14 14
     "status" => 201,
15 15
 ];
16 16
 
17
-if(!isset($_GET['u']))                  { $response->status = 400; die(json_encode($response)); } 
18
-if(!$__user_h->user_exists($_GET['u'])) { $response->status = 400; die(json_encode($response)); }
17
+if (!isset($_GET['u'])) { $response->status = 400; die(json_encode($response)); } 
18
+if (!$__user_h->user_exists($_GET['u'])) { $response->status = 400; die(json_encode($response)); }
19 19
 
20 20
 $_user = $__user_h->fetch_user_username($_GET['u']);
21 21
 $response = (object) [
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 $_user['featured_channels'] = explode($_user['featured_channels'], ",");
41 41
 $_user['featured_channels_object'] = (object) [];
42 42
 $i = 0;
43
-foreach($_user['featured_channels'] as $channel) {
43
+foreach ($_user['featured_channels'] as $channel) {
44 44
     $_user['featured_channels_object']->$i = $channel;
45 45
 }
46 46
 
Please login to merge, or discard this patch.
web/public/d/admin.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -11,8 +11,8 @@  discard block
 block discarded – undo
11 11
 <?php $__db_h = new db_helper(); ?>
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14
-    if(!isset($_SESSION['siteusername'])) { die(); }
15
-    if(!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
14
+    if (!isset($_SESSION['siteusername'])) { die(); }
15
+    if (!$__user_h->if_admin($_SESSION['siteusername'])) { die(); }
16 16
 
17 17
     $request = (object) [
18 18
         "action" => $_GET['action'],
@@ -49,8 +49,8 @@  discard block
 block discarded – undo
49 49
     );
50 50
     $request->tables_increment = 0;
51 51
 
52
-    if($request->action == "ban_users") {        
53
-        foreach($request->users as $username) {
52
+    if ($request->action == "ban_users") {        
53
+        foreach ($request->users as $username) {
54 54
             $stmt = $__db->prepare("DELETE FROM users WHERE username=:username");
55 55
             $stmt->execute(array(
56 56
                 ':username' => $username,
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 
134 134
             header("Location: /admin/bans");
135 135
         }
136
-    } else if($request->action == "delete_videos") {
137
-        foreach($request->videos as $video) {
136
+    } else if ($request->action == "delete_videos") {
137
+        foreach ($request->videos as $video) {
138 138
             $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:video");
139 139
             $stmt->execute(array(
140 140
                 ':video' => $video,
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
             header("Location: /admin/bans");
144 144
         }
145
-    } else if($request->action == "actually_just_ban") {
145
+    } else if ($request->action == "actually_just_ban") {
146 146
         $stmt = $__db->prepare("INSERT INTO bans (username, reason, expire, moderator) VALUES (:username, :reason, now(), :moderator)");
147 147
         $stmt->execute(array(
148 148
             ':username'  => $_POST['users'],
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         ));
152 152
 
153 153
         header("Location: /admin/bans");
154
-    } else if($request->action == "actually_just_ban_ip") {
154
+    } else if ($request->action == "actually_just_ban_ip") {
155 155
         $_user = $__user_h->fetch_user_username($_POST['users']);
156 156
 
157 157
         $stmt = $__db->prepare("INSERT INTO bans (username, reason, expire, moderator) VALUES (:username, :reason, now(), :moderator)");
Please login to merge, or discard this patch.
web/public/das_captcha.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
         <div id="page" class="">
50 50
         <!-- begin pagetop -->
51 51
   
52
-        <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php");?> </div>
52
+        <div id="masthead-container"><?php require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/header.php"); ?> </div>
53 53
   <!-- end pagetop -->
54 54
   <!-- begin pagemiddle -->
55 55
   <div id="content-container">
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
       
59 59
   <p class="largeText">Sorry for the interruption. We have been receiving a large volume of requests from your network. To continue with your SubRocks experience, please enter the verification code below.</p>
60 60
 
61
-<form method="post" action="/das_captcha?next=<?php echo $next;?>">
61
+<form method="post" action="/das_captcha?next=<?php echo $next; ?>">
62 62
 <script type="text/javascript" src="/s/js/captcha.js"></script>
63 63
 <noscript>
64 64
 You need JavaScript to pass the captcha!
Please login to merge, or discard this patch.
web/public/s/mod/sidebar_about.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,8 +34,8 @@
 block discarded – undo
34 34
 
35 35
 <div id="browse-side-column" class="ytg-2col ytg-last">
36 36
     <ol class="navigation-menu">
37
-        <?php foreach($__tabs as $_tab) { 
38
-            if($_SERVER['REQUEST_URI'] != $_tab->url)
37
+        <?php foreach ($__tabs as $_tab) { 
38
+            if ($_SERVER['REQUEST_URI'] != $_tab->url)
39 39
                 $_tab->selected = true;
40 40
             ?>
41 41
             <li class="menu-item">
Please login to merge, or discard this patch.