Test Failed
Pull Request — main (#29)
by
unknown
04:44 queued 02:01
created
web/public/playlists_ajax.php 2 patches
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -8,36 +8,36 @@
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ob_start(); ?>
10 10
 <?php
11
-   $request = (object) [
12
-      "search_term"      => $_SESSION['siteusername'],
13
-      "like_search_term" => "%" . $_SESSION['siteusername'] . "%",
14
-      "search_amount"    => 0 /* [fallback] */
15
-   ];
11
+    $request = (object) [
12
+        "search_term"      => $_SESSION['siteusername'],
13
+        "like_search_term" => "%" . $_SESSION['siteusername'] . "%",
14
+        "search_amount"    => 0 /* [fallback] */
15
+    ];
16 16
 
17
-   $stmt = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ");
18
-   $stmt->bindParam(":search", $request->like_search_term);
19
-   $stmt->execute(); 
20
-   $request->search_amount = $stmt->rowCount();
17
+    $stmt = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ");
18
+    $stmt->bindParam(":search", $request->like_search_term);
19
+    $stmt->execute(); 
20
+    $request->search_amount = $stmt->rowCount();
21 21
 
22
-   $results_per_page = 12;
23
-   $number_of_result = $request->search_amount;
24
-   $number_of_page = ceil ($number_of_result / $results_per_page);  
22
+    $results_per_page = 12;
23
+    $number_of_result = $request->search_amount;
24
+    $number_of_page = ceil ($number_of_result / $results_per_page);  
25 25
 
26
-   if (!isset ($_GET['page']) ) {  
27
-       $page = 1;  
28
-   } else {  
29
-       $page = (int)$_GET['page'];  
30
-   }  
26
+    if (!isset ($_GET['page']) ) {  
27
+        $page = 1;  
28
+    } else {  
29
+        $page = (int)$_GET['page'];  
30
+    }  
31 31
 
32
-   $page_first_result = ($page - 1) * $results_per_page;  
32
+    $page_first_result = ($page - 1) * $results_per_page;  
33 33
 
34
-   $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
35
-   $stmt6->bindParam(":search", $request->like_search_term);
36
-   $stmt6->bindParam(":pfirst", $page_first_result);
37
-   $stmt6->bindParam(":pper", $results_per_page);
38
-   $stmt6->execute();
34
+    $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
35
+    $stmt6->bindParam(":search", $request->like_search_term);
36
+    $stmt6->bindParam(":pfirst", $page_first_result);
37
+    $stmt6->bindParam(":pper", $results_per_page);
38
+    $stmt6->execute();
39 39
 
40
-   /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */
40
+    /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */
41 41
 ?>               
42 42
 <table style="width: 100%;">
43 43
     <tr>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,15 +21,15 @@  discard block
 block discarded – undo
21 21
 
22 22
    $results_per_page = 12;
23 23
    $number_of_result = $request->search_amount;
24
-   $number_of_page = ceil ($number_of_result / $results_per_page);  
24
+   $number_of_page = ceil($number_of_result/$results_per_page);  
25 25
 
26
-   if (!isset ($_GET['page']) ) {  
26
+   if (!isset ($_GET['page'])) {  
27 27
        $page = 1;  
28 28
    } else {  
29
-       $page = (int)$_GET['page'];  
29
+       $page = (int) $_GET['page'];  
30 30
    }  
31 31
 
32
-   $page_first_result = ($page - 1) * $results_per_page;  
32
+   $page_first_result = ($page - 1)*$results_per_page;  
33 33
 
34 34
    $stmt6 = $__db->prepare("SELECT * FROM playlists WHERE lower(author) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
35 35
    $stmt6->bindParam(":search", $request->like_search_term);
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
     </tr>
51 51
     
52 52
     <?php
53
-        while($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
53
+        while ($playlist = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
54 54
             $playlist['videos'] = json_decode($playlist['videos']);
55
-            if($__video_h->video_exists(@$playlist['videos'][0])) {
56
-                if(count($playlist['videos']) != 0) {
55
+            if ($__video_h->video_exists(@$playlist['videos'][0])) {
56
+                if (count($playlist['videos']) != 0) {
57 57
                     $video = $__video_h->fetch_video_rid($playlist['videos'][0]);
58 58
                     $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
59 59
                     $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
Please login to merge, or discard this patch.
web/public/edit_playlist.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 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 $_playlist = $__video_h->fetch_playlist_rid($_GET['id']); ?>
18 18
 <!DOCTYPE html>
19 19
 <html dir="ltr">
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,10 +8,10 @@
 block discarded – undo
8 8
 <?php $__db_h = new db_helper(); ?>
9 9
 <?php $__time_h = new time_helper(); ?>
10 10
 <?php
11
-	$__server->page_embeds->page_title = "SubRocks - Edit Playlist";
12
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
11
+    $__server->page_embeds->page_title = "SubRocks - Edit Playlist";
12
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
13
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
14
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
15 15
 ?>
16 16
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
17 17
 <?php $_playlist = $__video_h->fetch_playlist_rid($_GET['id']); ?>
Please login to merge, or discard this patch.
web/public/get/toggle_comment.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -13,8 +13,8 @@
 block discarded – undo
13 13
 <?php
14 14
 $video = $__video_h->fetch_video_rid($_GET['id']);
15 15
 
16
-if($video['author'] == $_SESSION['siteusername']) {
17
-    if($video['commenting'] == "a") {
16
+if ($video['author'] == $_SESSION['siteusername']) {
17
+    if ($video['commenting'] == "a") {
18 18
         $__video_u->update_row($_GET['id'], "commenting", "d");
19 19
     } else {
20 20
         $__video_u->update_row($_GET['id'], "commenting", "a");
Please login to merge, or discard this patch.
web/public/get/delete_video.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,11 +12,11 @@
 block discarded – undo
12 12
 <?php
13 13
 
14 14
 if($video['author'] == $_SESSION['siteusername']) {
15
-  $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author");
16
-  $stmt->execute(array(
15
+    $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author");
16
+    $stmt->execute(array(
17 17
     ':author' => $video['author'],
18 18
     ':rid' => $video['rid'],
19
-  ));
19
+    ));
20 20
 }
21 21
 
22 22
 header('Location: /my_videos');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 <?php $video = $__video_h->fetch_video_rid($_GET['id']); ?>
12 12
 <?php
13 13
 
14
-if($video['author'] == $_SESSION['siteusername']) {
14
+if ($video['author'] == $_SESSION['siteusername']) {
15 15
   $stmt = $__db->prepare("DELETE FROM videos WHERE rid=:rid AND author=:author");
16 16
   $stmt->execute(array(
17 17
     ':author' => $video['author'],
Please login to merge, or discard this patch.
web/public/d/edit_playlist.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
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14 14
     $_playlist = $__video_h->fetch_playlist_rid($_GET['v']);
15
-    if($_playlist['author'] != @$_SESSION['siteusername']) {
15
+    if ($_playlist['author'] != @$_SESSION['siteusername']) {
16 16
         die();
17 17
     }
18 18
 
Please login to merge, or discard this patch.
web/public/d/edit_video.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 <?php $__time_h = new time_helper(); ?>
13 13
 <?php
14 14
     $_video = $__video_h->fetch_video_rid($_GET['v']);
15
-    if($_video['author'] != @$_SESSION['siteusername']) {
15
+    if ($_video['author'] != @$_SESSION['siteusername']) {
16 16
         die();
17 17
     }
18 18
 
@@ -37,8 +37,8 @@  discard block
 block discarded – undo
37 37
     // $__video_u->update_row($_GET['v'], "thumbnail", $request->thumbnail);
38 38
     $__video_u->update_row($_GET['v'], "category", $request->category);
39 39
 
40
-    if($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['thumbnail']) {
41
-        if(!empty($_FILES["thumbnail"]["name"])) {
40
+    if ($_SERVER['REQUEST_METHOD'] == 'POST' && @$_FILES['thumbnail']) {
41
+        if (!empty($_FILES["thumbnail"]["name"])) {
42 42
             $target_dir = "dynamic/thumbs/";
43 43
             $imageFileType = strtolower(pathinfo($_FILES["thumbnail"]["name"], PATHINFO_EXTENSION));
44 44
             $target_name = md5_file($_FILES["thumbnail"]["tmp_name"]) . "." . $imageFileType;
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
             $uploadOk = true;
49 49
             $movedFile = false;
50 50
     
51
-            if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
52
-                && $imageFileType != "gif" ) {
51
+            if ($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg"
52
+                && $imageFileType != "gif") {
53 53
                 $fileerror = 'unsupported file type. must be jpg, png, jpeg, or gif';
54 54
                 $uploadOk = false;
55 55
                 goto skip;
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
         "description" => $_POST['description'],
24 24
         "tags" => $_POST['tags'],
25 25
         "privacy" => $_POST['privacy'],
26
-         /* 
26
+            /* 
27 27
             Public   : n
28 28
             Unlisted : u
29 29
             Private  : v
Please login to merge, or discard this patch.
web/public/s/mod/sidebar.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,8 +39,8 @@
 block discarded – undo
39 39
 ?>
40 40
 <div id="browse-side-column" class="ytg-2col ytg-last">
41 41
     <ol class="navigation-menu">
42
-        <?php foreach($__tabs as $_tab) { 
43
-            if(parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH) != $_tab->url)
42
+        <?php foreach ($__tabs as $_tab) { 
43
+            if (parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH) != $_tab->url)
44 44
                 $_tab->selected = true;
45 45
             ?>
46 46
             <li class="menu-item">
Please login to merge, or discard this 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 3 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -12,26 +12,26 @@
 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
-	$_video = $__video_h->fetch_video_rid($_GET['v']); 
19
-	$_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
20
-	$_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
21
-	$_video['duration'] = $__time_h->timestamp($_video['duration']);
22
-	$_video['views'] = $__video_h->fetch_video_views($_video['rid']);
23
-	$_video['author'] = htmlspecialchars($_video['author']);		
24
-	$_video['title'] = htmlspecialchars($_video['title']);
25
-	$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
18
+    $_video = $__video_h->fetch_video_rid($_GET['v']); 
19
+    $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
20
+    $_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
21
+    $_video['duration'] = $__time_h->timestamp($_video['duration']);
22
+    $_video['views'] = $__video_h->fetch_video_views($_video['rid']);
23
+    $_video['author'] = htmlspecialchars($_video['author']);		
24
+    $_video['title'] = htmlspecialchars($_video['title']);
25
+    $_video['description'] = $__video_h->shorten_description($_video['description'], 50);
26 26
 
27 27
     if($_SESSION['siteusername'] != $_video['author'])
28 28
         header("Location: /");
29 29
 ?>
30 30
 <?php
31
-	$__server->page_embeds->page_title = "SubRocks - Uploaded Video";
32
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
33
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
34
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
31
+    $__server->page_embeds->page_title = "SubRocks - Uploaded Video";
32
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
33
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
34
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
35 35
 ?>
36 36
 <!DOCTYPE html>
37 37
 <html>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  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']))
15
+	if (!$__video_h->video_exists($_GET['v']))
16 16
 		header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag.");
17 17
 
18 18
 	$_video = $__video_h->fetch_video_rid($_GET['v']); 
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
 	$_video['title'] = htmlspecialchars($_video['title']);
25 25
 	$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
26 26
 
27
-    if($_SESSION['siteusername'] != $_video['author'])
27
+    if ($_SESSION['siteusername'] != $_video['author'])
28 28
         header("Location: /");
29 29
 ?>
30 30
 <?php
Please login to merge, or discard this 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/d/signup.php 1 patch
Spacing   +9 added lines, -9 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($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
11
+    if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['password'] && $_POST['username']) {
12 12
         $request = (object) [
13 13
             "username" => $_POST['username'],
14 14
             "password" => $_POST['password'],
@@ -22,25 +22,25 @@  discard block
 block discarded – undo
22 22
         ]; 
23 23
 
24 24
         if (!filter_var($request->email, FILTER_VALIDATE_EMAIL)) 
25
-            { $request->error->message = "Your email is invalid!"; $request->error->status = "";  }
26
-        if(strlen($request->username) > 21) 
25
+            { $request->error->message = "Your email is invalid!"; $request->error->status = ""; }
26
+        if (strlen($request->username) > 21) 
27 27
             { $request->error->message = "Your username must be shorter than 20 characters."; $request->error->status = ""; }
28
-        if(strlen($request->password) < 8) 
28
+        if (strlen($request->password) < 8) 
29 29
             { $request->error->message = "Your password must at least be 8 characters long."; $request->error->status = ""; }
30
-        if(!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) 
30
+        if (!preg_match('/[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/', $request->password)) 
31 31
             { $request->error->message = "Include numbers and letters in your password!"; $request->error->status = ""; }
32
-        if(!preg_match('/^\S+\w\S{1,}/', $request->username)) 
32
+        if (!preg_match('/^\S+\w\S{1,}/', $request->username)) 
33 33
             { $request->error->message = "Your username cannot contain any special characters!"; $request->error->status = ""; }
34
-        if(empty(trim($request->username))) 
34
+        if (empty(trim($request->username))) 
35 35
             { $request->error->message = "Your username cannot be empty!"; $request->error->status = ""; }
36 36
         
37 37
         $stmt = $__db->prepare("SELECT username FROM users WHERE username = :username");
38 38
         $stmt->bindParam(":username", $request->username);
39 39
         $stmt->execute();
40
-        if($stmt->rowCount()) 
40
+        if ($stmt->rowCount()) 
41 41
             { $request->error->message = "There's already a user with that same username!"; $request->error->status = ""; }
42 42
         
43
-        if($request->error->status == "OK") {
43
+        if ($request->error->status == "OK") {
44 44
             $stmt = $__db->prepare("INSERT INTO users (username, email, password) VALUES (:username, :email, :password)");
45 45
             $stmt->bindParam(":username", $request->username);
46 46
             $stmt->bindParam(":email", $request->email);
Please login to merge, or discard this patch.