Test Failed
Push — main ( b1c027...83cec3 )
by chief
03:12
created
web/public/upload_video.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 <?php $__user_h = new user_helper($__db); ?>
9 9
 <?php $__db_h = new db_helper(); ?>
10 10
 <?php $__time_h = new time_helper(); ?>
11
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
12 12
 <?php
13 13
 	$__server->page_embeds->page_title = "SubRocks - Upload Video";
14 14
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
                                 <b>Category</b> <br>
97 97
                                 <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default">
98 98
                                     <?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"]; ?>
99
-                                    <?php foreach($categories as $categoryTag) { ?>
99
+                                    <?php foreach ($categories as $categoryTag) { ?>
100 100
                                         <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option>
101 101
                                     <?php } ?>
102 102
                                 </select><br><br>
Please login to merge, or discard this patch.
web/public/uploaded_video.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10 10
 <?php
11
-	if(!$__video_h->video_exists($_GET['v']))
11
+	if (!$__video_h->video_exists($_GET['v']))
12 12
 		header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag.");
13 13
 
14 14
 	$video = $__video_h->fetch_video_rid($_GET['v']);
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	$video['title'] = htmlspecialchars($video['title']);
21 21
 	$video['description'] = $__video_h->shorten_description($video['description'], 50);
22 22
 
23
-    if($_SESSION['siteusername'] != $video['author'])
23
+    if ($_SESSION['siteusername'] != $video['author'])
24 24
         header("Location: /");
25 25
 ?>
26 26
 <?php
Please login to merge, or discard this patch.
web/public/subscriptions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 <?php $__user_h = new user_helper($__db); ?>
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
10
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11 11
 <?php
12 12
 	$__server->page_embeds->page_title = "SubRocks - Subscriptions";
13 13
 	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
                                 ?>                    
164 164
                                 
165 165
                                 <div class="my_videos_ajax">                                  
166
-                                    <?php while($user = $stmt->fetch(PDO::FETCH_ASSOC)) {  ?> 
166
+                                    <?php while ($user = $stmt->fetch(PDO::FETCH_ASSOC)) {  ?> 
167 167
                                         <div style="width: 33%;display: inline-block;">
168 168
                                             <img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($user['reciever']); ?>">
169 169
                                             <span style="display: inline-block; vertical-align:top;width: 100px;font-size: 11px;">
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
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14 14
 	$__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 ?>
16
-<?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
16
+<?php if (!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
17 17
 <?php $_video = $__video_h->fetch_video_rid($_GET['id']); ?>
18 18
 <!DOCTYPE html>
19 19
 <html dir="ltr">
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
                                         <b>Category</b> <br>
178 178
                                         <select style="margin-top:5px;" name="category" class="yt-uix-button yt-uix-button-default">
179 179
                                             <?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"]; ?>
180
-                                            <?php foreach($categories as $categoryTag) { ?>
180
+                                            <?php foreach ($categories as $categoryTag) { ?>
181 181
                                                 <option value="<?php echo $categoryTag; ?>"><?php echo $categoryTag; ?></option>
182 182
                                             <?php } ?>
183 183
                                         </select><br><br>
Please login to merge, or discard this patch.
web/public/watch.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -11,19 +11,19 @@  discard block
 block discarded – undo
11 11
 <?php $__user_u = new user_update($__db); ?>
12 12
 <?php $__db_h = new db_helper(); ?>
13 13
 <?php $__time_h = new time_helper(); ?>
14
-<?php if(!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
14
+<?php if (!$__video_h->video_exists($_GET['v'])) { header("Location: /?error=This video doesn't exist!"); } ?>
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($_SERVER['REQUEST_METHOD'] == 'POST') {
18
+    if ($_SERVER['REQUEST_METHOD'] == 'POST') {
19 19
         $error = array();
20 20
 
21
-        if(!isset($_SESSION['siteusername'])){ $error['message'] = "you are not logged in"; $error['status'] = true; }
22
-        if(!$_POST['comment']){ $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
23
-        if(strlen($_POST['comment']) > 1000){ $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
24
-        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; }
21
+        if (!isset($_SESSION['siteusername'])) { $error['message'] = "you are not logged in"; $error['status'] = true; }
22
+        if (!$_POST['comment']) { $error['message'] = "your comment cannot be blank"; $error['status'] = true; }
23
+        if (strlen($_POST['comment']) > 1000) { $error['message'] = "your comment must be shorter than 1000 characters"; $error['status'] = true; }
24
+        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; }
25 25
 
26
-        if(!isset($error['message'])) {
26
+        if (!isset($error['message'])) {
27 27
 			$text = $_POST['comment'];
28 28
             $stmt = $__db->prepare("INSERT INTO comments (toid, author, comment) VALUES (:v, :username, :comment)");
29 29
             $stmt->bindParam(":v", $_GET['v']);
@@ -80,20 +80,20 @@  discard block
 block discarded – undo
80 80
          if (window.yt.timing) {yt.timing.tick("ct");}    
81 81
       </script>
82 82
 		<?php
83
-			$_video['dislikes'] =  $__video_h->get_video_stars_level($_video['rid'], 1);
83
+			$_video['dislikes'] = $__video_h->get_video_stars_level($_video['rid'], 1);
84 84
 			$_video['dislikes'] += $__video_h->get_video_stars_level($_video['rid'], 2);
85 85
 
86
-			$_video['likes'] =     $__video_h->get_video_stars_level($_video['rid'], 4);
87
-			$_video['likes'] +=    $__video_h->get_video_stars_level($_video['rid'], 5);
86
+			$_video['likes'] = $__video_h->get_video_stars_level($_video['rid'], 4);
87
+			$_video['likes'] += $__video_h->get_video_stars_level($_video['rid'], 5);
88 88
 
89 89
 			$_video['dislikes'] += $__video_h->get_video_likes($_video['rid'], false);
90 90
 			$_video['likes'] += $__video_h->get_video_likes($_video['rid'], true);
91 91
 
92
-			if($_video['likes'] == 0 && $_video['dislikes'] == 0) {
92
+			if ($_video['likes'] == 0 && $_video['dislikes'] == 0) {
93 93
 				$_video['likeswidth'] = 50;
94 94
 				$_video['dislikeswidth'] = 50;
95 95
 			} else {
96
-				$_video['likeswidth'] = $_video['likes'] / ($_video['likes'] + $_video['dislikes']) * 100;
96
+				$_video['likeswidth'] = $_video['likes']/($_video['likes'] + $_video['dislikes'])*100;
97 97
 				$_video['dislikeswidth'] = 100 - $_video['likeswidth'];
98 98
 			}
99 99
 
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 									</div>
128 128
 									<div id="instream_google_companion_ad_div"></div>
129 129
 								</div>
130
-								<?php if(@$_SESSION['siteusername'] == $_video['author']) { ?>
130
+								<?php if (@$_SESSION['siteusername'] == $_video['author']) { ?>
131 131
 									<div id="watch-owner-container">
132 132
 										<div id="masthead-subnav" class="yt-nav yt-nav-dark ">
133 133
 											<ul class="yt-nav-aside">
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 											title="" 
163 163
 											id="subscribe-button"
164 164
 											type="button" 
165
-											class="<?php if($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
165
+											class="<?php if ($_video['subscribed']) { echo "subscribed "; } ?>yt-subscription-button  yt-uix-button yt-uix-button-subscription yt-uix-tooltip" 
166 166
 											role="button">
167 167
 											<span class="yt-uix-button-icon-wrapper">
168 168
 												<img class="yt-uix-button-icon yt-uix-button-icon-subscribe" src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" alt="">
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 											<button onclick=";like_video();return false;"
244 244
 											title="I like this" 
245 245
 											type="button" 
246
-											class="start <?php if($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
246
+											class="start <?php if ($_video['liked']) { echo "liked "; } ?>yt-uix-tooltip-reverse  yt-uix-button yt-uix-button-default yt-uix-tooltip" 
247 247
 											id="watch-like"  
248 248
 											href="/get/like_video?v=<?php echo $_video['rid']; ?>"
249 249
 											role="button"><span class="yt-uix-button-icon-wrapper">
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 											type="button" 
258 258
 											style="margin-left: -2px;"
259 259
 											href="/get/dislike_video?v=<?php echo $_video['rid']; ?>"
260
-											class="end yt-uix-tooltip-reverse <?php if($_video['disliked']) { echo "unliked "; } ?>  yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" 
260
+											class="end yt-uix-tooltip-reverse <?php if ($_video['disliked']) { echo "unliked "; } ?>  yt-uix-button yt-uix-button-default yt-uix-tooltip yt-uix-button-empty" 
261 261
 											id="watch-unlike" 
262 262
 											role="button">
263 263
 												<span class="yt-uix-button-icon-wrapper">
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
 												not implemented ismnf
276 276
 											</div>
277 277
 											<div id="watch-actions-logged-out" class="watch-actions-panel hid">
278
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
278
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
279 279
 												<div class="yt-alert yt-alert-naked yt-alert-warn  ">
280 280
 													<div class="yt-alert-icon">
281 281
 														<img src="//s.ytimg.com/yt/img/pixel-vfl3z5WfW.gif" class="icon master-sprite" alt="Alert icon">
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 												<?php } else { ?>
292 292
 													<h3>Be friends with the creator</h3>
293 293
 
294
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
294
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
295 295
 														<img style="width: 50px;height:50px;" src="/dynamic/pfp/<?php echo $__user_h->fetch_pfp($_video['author']); ?>">
296 296
 														<span style="display: inline-block; vertical-align:top;width: 100px;font-size:11px;">
297 297
 															<b><a href="/user/<?php echo htmlspecialchars($_video['author']); ?>"><?php echo htmlspecialchars($_video['author']); ?></a></b><br>
@@ -305,8 +305,8 @@  discard block
 block discarded – undo
305 305
 														</span><br><br>
306 306
 													<?php } ?>
307 307
 
308
-													<?php if($_SESSION['siteusername'] != $_video['author']) { ?>
309
-														<?php if($_video['friended'] == false) { ?>
308
+													<?php if ($_SESSION['siteusername'] != $_video['author']) { ?>
309
+														<?php if ($_video['friended'] == false) { ?>
310 310
 															<a href="/friends">Send a friend request</a>
311 311
 														<?php } else { ?>
312 312
 															Your friend request is pending.
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 													<?php } ?>
317 317
 													<hr><br>
318 318
 													<h3>Add to Favorites</h3>
319
-													<?php if($_video['favorited'] == false) { ?>
319
+													<?php if ($_video['favorited'] == false) { ?>
320 320
 														<a href="/get/favorite?v=<?php echo $_video['rid']; ?>">Favorite Video</a>
321 321
 													<?php } else { ?>
322 322
 														<a href="/get/unfavorite?v=<?php echo $_video['rid']; ?>">Unfavorite Video</a>
@@ -327,10 +327,10 @@  discard block
 block discarded – undo
327 327
 														$stmt = $__db->prepare("SELECT * FROM playlists WHERE author = :username ORDER BY id DESC LIMIT 20");
328 328
 														$stmt->bindParam(":username", $_SESSION['siteusername']);
329 329
 														$stmt->execute();
330
-														while($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
330
+														while ($playlist = $stmt->fetch(PDO::FETCH_ASSOC)) { 
331 331
 															$buffer = json_decode($playlist['videos']);
332 332
 															@$rid = $buffer[0];
333
-															if(!empty($rid)) {
333
+															if (!empty($rid)) {
334 334
 																@$video = $__video_h->fetch_video_rid($rid);
335 335
 															} else {
336 336
 																$video['thumbnail'] = "";
@@ -608,7 +608,7 @@  discard block
 block discarded – undo
608 608
 												$stmt->execute();
609 609
 											?>
610 610
 
611
-											<?php if($stmt->rowCount() != 0) { ?>
611
+											<?php if ($stmt->rowCount() != 0) { ?>
612 612
 												<div class="comments-section">
613 613
 													<a class="comments-section-see-all" href="/video_response_view_all?v=<?php echo htmlspecialchars($_video['rid']); ?>">
614 614
 													see all
@@ -616,8 +616,8 @@  discard block
 block discarded – undo
616 616
 													<h4>Video Responses</h4>
617 617
 													<ul class="video-list">
618 618
 													<?php 
619
-														while($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
620
-															if($__video_h->video_exists($video['video'])) { 
619
+														while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) { 
620
+															if ($__video_h->video_exists($video['video'])) { 
621 621
 																$video = $__video_h->fetch_video_rid($video['video']);
622 622
 																$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
623 623
 																$video['duration'] = $__time_h->timestamp($video['duration']);
@@ -648,19 +648,19 @@  discard block
 block discarded – undo
648 648
 														</h4>
649 649
 													</div>
650 650
 												</div>
651
-												<?php if(!isset($_SESSION['siteusername'])) { ?>
651
+												<?php if (!isset($_SESSION['siteusername'])) { ?>
652 652
 													<div class="comments-post-container clearfix">
653 653
 														<div class="comments-post-alert">
654 654
 															<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>
655 655
 														</div>
656 656
 													</div>
657
-												<?php } else if($_video['commenting'] == "d") { ?>
657
+												<?php } else if ($_video['commenting'] == "d") { ?>
658 658
 													<div class="comments-post-container clearfix">
659 659
 														<div class="comments-post-alert">
660 660
 															This video has comemnting disabled!
661 661
 														</div>
662 662
 													</div>
663
-												<?php } else if($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
663
+												<?php } else if ($__user_h->if_blocked($_video['author'], $_SESSION['siteusername'])) { ?>
664 664
 													<div class="comments-post-container clearfix">
665 665
 														<div class="comments-post-alert">
666 666
 															This user has blocked you!
@@ -714,15 +714,15 @@  discard block
 block discarded – undo
714 714
 														$stmt->execute();
715 715
 
716 716
 														$number_of_result = $stmt->rowCount();
717
-														$number_of_page = ceil ($number_of_result / $results_per_page);  
717
+														$number_of_page = ceil($number_of_result/$results_per_page);  
718 718
 
719
-														if (!isset ($_GET['page']) ) {  
719
+														if (!isset ($_GET['page'])) {  
720 720
 															$page = 1;  
721 721
 														} else {  
722
-															$page = (int)$_GET['page'];  
722
+															$page = (int) $_GET['page'];  
723 723
 														}  
724 724
 
725
-														$page_first_result = ($page - 1) * $results_per_page;  
725
+														$page_first_result = ($page - 1)*$results_per_page;  
726 726
 
727 727
 														$stmt = $__db->prepare("SELECT * FROM comments WHERE toid = :rid ORDER BY id DESC LIMIT :pfirst, :pper");
728 728
 														$stmt->bindParam(":rid", $_video['rid']);
@@ -730,7 +730,7 @@  discard block
 block discarded – undo
730 730
 														$stmt->bindParam(":pper", $results_per_page);
731 731
 														$stmt->execute();
732 732
 
733
-														while($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
733
+														while ($comment = $stmt->fetch(PDO::FETCH_ASSOC)) { 
734 734
 													?>
735 735
 
736 736
 													<li class="comment yt-tile-default " data-author-viewing="" data-author-id="-uD01K8FQTeOSS5sniRFzQ" data-id="HdQrMeklJ_5hd_uPDRcvtdaMk2pMVS8d9sufcfiGx0U" data-score="0">
@@ -812,7 +812,7 @@  discard block
 block discarded – undo
812 812
 												<?php
813 813
 													$stmt = $__db->prepare("SELECT * FROM videos ORDER BY rand() LIMIT 20");
814 814
 													$stmt->execute();
815
-													while($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
815
+													while ($video = $stmt->fetch(PDO::FETCH_ASSOC)) {	
816 816
 														$video['age'] = $__time_h->time_elapsed_string($video['publish']);		
817 817
 														$video['duration'] = $__time_h->timestamp($video['duration']);
818 818
 														$video['views'] = $__video_h->fetch_video_views($video['rid']);
Please login to merge, or discard this patch.