Test Failed
Pull Request — main (#26)
by
unknown
03:25
created
web/public/results.php 1 patch
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -4,46 +4,46 @@  discard block
 block discarded – undo
4 4
 <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/user_helper.php"); ?>
5 5
 <?php require_once($_SERVER['DOCUMENT_ROOT'] . "/s/classes/video_helper.php"); ?>
6 6
 <?php
7
-   $request = (object) [
8
-      "search_term"      => htmlspecialchars($_GET['search_query']),
9
-      "like_search_term" => "%" . htmlspecialchars($_GET['search_query']) . "%",
10
-      "search_amount"    => 0 /* [fallback] */
11
-   ];
7
+    $request = (object) [
8
+        "search_term"      => htmlspecialchars($_GET['search_query']),
9
+        "like_search_term" => "%" . htmlspecialchars($_GET['search_query']) . "%",
10
+        "search_amount"    => 0 /* [fallback] */
11
+    ];
12 12
 
13
-   $stmt = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ");
14
-   $stmt->bindParam(":search", $request->like_search_term);
15
-   $stmt->execute(); 
16
-   $request->search_amount = $stmt->rowCount();
13
+    $stmt = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ");
14
+    $stmt->bindParam(":search", $request->like_search_term);
15
+    $stmt->execute(); 
16
+    $request->search_amount = $stmt->rowCount();
17 17
 
18
-   $results_per_page = 12;
19
-   $number_of_result = $request->search_amount;
20
-   $number_of_page = ceil ($number_of_result / $results_per_page);  
18
+    $results_per_page = 12;
19
+    $number_of_result = $request->search_amount;
20
+    $number_of_page = ceil ($number_of_result / $results_per_page);  
21 21
 
22
-   if (!isset ($_GET['page']) ) {  
23
-       $page = 1;  
24
-   } else {  
25
-       $page = (int)$_GET['page'];  
26
-   }  
22
+    if (!isset ($_GET['page']) ) {  
23
+        $page = 1;  
24
+    } else {  
25
+        $page = (int)$_GET['page'];  
26
+    }  
27 27
 
28
-   $page_first_result = ($page - 1) * $results_per_page;  
28
+    $page_first_result = ($page - 1) * $results_per_page;  
29 29
 
30
-   $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
31
-   $stmt6->bindParam(":search", $request->like_search_term);
32
-   $stmt6->bindParam(":pfirst", $page_first_result);
33
-   $stmt6->bindParam(":pper", $results_per_page);
34
-   $stmt6->execute();
30
+    $stmt6 = $__db->prepare("SELECT * FROM videos WHERE lower(title) LIKE lower(:search) ORDER BY id DESC LIMIT :pfirst, :pper");
31
+    $stmt6->bindParam(":search", $request->like_search_term);
32
+    $stmt6->bindParam(":pfirst", $page_first_result);
33
+    $stmt6->bindParam(":pper", $results_per_page);
34
+    $stmt6->execute();
35 35
 
36
-   /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */
36
+    /* TODO :: Easy & Clean Pagination Class PLZ :((( ))) */
37 37
 ?>
38 38
 <?php $__video_h = new video_helper($__db); ?>
39 39
 <?php $__user_h = new user_helper($__db); ?>
40 40
 <?php $__db_h = new db_helper(); ?>
41 41
 <?php $__time_h = new time_helper(); ?>
42 42
 <?php
43
-	$__server->page_embeds->page_title = "SubRocks - Search";
44
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
45
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
46
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
43
+    $__server->page_embeds->page_title = "SubRocks - Search";
44
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
45
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
46
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
47 47
 ?>
48 48
 <!DOCTYPE html>
49 49
 <html>
@@ -219,14 +219,14 @@  discard block
 block discarded – undo
219 219
                   <div id="results-main-content">
220 220
                      <ol id="search-results">
221 221
                         <?php
222
-                           while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
223
-                              $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
224
-                              $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
225
-                              $video['duration'] = $__time_h->timestamp($video['duration']);
226
-                              $video['views'] = $__video_h->fetch_video_views($video['rid']);
227
-                              $video['author'] = htmlspecialchars($video['author']);		
228
-                              $video['title'] = htmlspecialchars($video['title']);
229
-                              $video['description'] = $__video_h->shorten_description($video['description'], 50, true);
222
+                            while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
223
+                                $video['video_responses'] = $__video_h->get_video_responses($video['rid']);
224
+                                $video['age'] = $__time_h->time_elapsed_string($video['publish']);		
225
+                                $video['duration'] = $__time_h->timestamp($video['duration']);
226
+                                $video['views'] = $__video_h->fetch_video_views($video['rid']);
227
+                                $video['author'] = htmlspecialchars($video['author']);		
228
+                                $video['title'] = htmlspecialchars($video['title']);
229
+                                $video['description'] = $__video_h->shorten_description($video['description'], 50, true);
230 230
                         ?>
231 231
                               <li class="yt-grid-box result-item-video *sr ">
232 232
                                  <div id="" class="yt-uix-tile yt-lockup-list yt-tile-default yt-grid-box ">
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
                               </li>
255 255
                         <?php } ?>
256 256
                         <?php if($request->search_amount == 0)
257
-                           echo "Your search query has brought no results.<br><br>";
257
+                            echo "Your search query has brought no results.<br><br>";
258 258
                         ?>
259 259
                      </ol>
260 260
                   </div>
Please login to merge, or discard this patch.
web/public/upload.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
  
3 3
 if (empty($_FILES) || $_FILES["file"]["error"]) {
4
-  die('{"OK": 0}');
4
+    die('{"OK": 0}');
5 5
 }
6 6
  
7 7
 $fileName = $_FILES["file"]["name"];
Please login to merge, or discard this patch.
web/public/playlists_ajax.php 1 patch
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.
web/public/get/delete_video.php 1 patch
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.
web/public/uploaded_video.php 1 patch
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.
web/public/my_videos.php 1 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 - My Videos";
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 - My Videos";
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
 <!DOCTYPE html>
Please login to merge, or discard this patch.
web/public/playlists.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,10 +37,10 @@
 block discarded – undo
37 37
     }
38 38
 ?>
39 39
 <?php
40
-	$__server->page_embeds->page_title = "SubRocks - Your Playlists";
41
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
42
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
43
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
40
+    $__server->page_embeds->page_title = "SubRocks - Your Playlists";
41
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
42
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
43
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
44 44
 ?>
45 45
 <!DOCTYPE html>
46 46
 <html dir="ltr">
Please login to merge, or discard this patch.
web/public/edit_playlist.php 1 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/favorite_videos.php 1 patch
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -9,10 +9,10 @@  discard block
 block discarded – undo
9 9
 <?php $__time_h = new time_helper(); error_reporting(E_ERROR | E_PARSE); ?>
10 10
 <?php if(!isset($_SESSION['siteusername'])) { header("Location: /sign_in"); } ?>
11 11
 <?php
12
-	$__server->page_embeds->page_title = "SubRocks - Favorite Videos";
13
-	$__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
14
-	$__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
15
-	$__server->page_embeds->page_url = "https://subrock.rocks/";
12
+    $__server->page_embeds->page_title = "SubRocks - Favorite Videos";
13
+    $__server->page_embeds->page_description = "SubRocks is a site dedicated to bring back the 2012 layout of YouTube.";
14
+    $__server->page_embeds->page_image = "/yt/imgbin/full-size-logo.png";
15
+    $__server->page_embeds->page_url = "https://subrock.rocks/";
16 16
 ?>
17 17
 <!DOCTYPE html>
18 18
 <html dir="ltr">
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
                                 ?>
179 179
                                 <?php 
180 180
                                     $stmt6 = $__db->prepare("SELECT * FROM favorite_video WHERE sender = :search ORDER BY id DESC LIMIT :pfirst, :pper");
181
-									$stmt6->bindParam(":search", $search);
181
+                                    $stmt6->bindParam(":search", $search);
182 182
                                     $stmt6->bindParam(":pfirst", $page_first_result);
183 183
                                     $stmt6->bindParam(":pper", $results_per_page);
184 184
                                     $stmt6->execute();
@@ -195,32 +195,32 @@  discard block
 block discarded – undo
195 195
                                     
196 196
                                     <?php
197 197
                                         while($video = $stmt6->fetch(PDO::FETCH_ASSOC)) { 
198
-											if($__video_h->video_exists($video['reciever'])) {
199
-												$_video = $__video_h->fetch_video_rid($video['reciever']);
200
-												$_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
201
-												$_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
202
-												$_video['duration'] = $__time_h->timestamp($_video['duration']);
203
-												$_video['views'] = $__video_h->fetch_video_views($_video['rid']);
204
-												$_video['author'] = htmlspecialchars($_video['author']);		
205
-												$_video['title'] = htmlspecialchars($_video['title']);
206
-												$_video['description'] = $__video_h->shorten_description($_video['description'], 50);
207
-
208
-												if($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") {
209
-													$status = "Corrupted";
210
-												} else if($_video['visibility'] == "v") {
211
-													$status = "Approved";
212
-												} else if($_video['visibility'] == "n") {
213
-													$status = "Approved";
214
-												} else if($_video['visibility'] == "o") {
215
-													$status = "Disapproved";
216
-												} else {
217
-													$status = "Unknown";
218
-												}                      
198
+                                            if($__video_h->video_exists($video['reciever'])) {
199
+                                                $_video = $__video_h->fetch_video_rid($video['reciever']);
200
+                                                $_video['video_responses'] = $__video_h->get_video_responses($_video['rid']);
201
+                                                $_video['age'] = $__time_h->time_elapsed_string($_video['publish']);		
202
+                                                $_video['duration'] = $__time_h->timestamp($_video['duration']);
203
+                                                $_video['views'] = $__video_h->fetch_video_views($_video['rid']);
204
+                                                $_video['author'] = htmlspecialchars($_video['author']);		
205
+                                                $_video['title'] = htmlspecialchars($_video['title']);
206
+                                                $_video['description'] = $__video_h->shorten_description($_video['description'], 50);
207
+
208
+                                                if($_video['thumbnail'] == ".png" && $_video['filename'] == ".mp4") {
209
+                                                    $status = "Corrupted";
210
+                                                } else if($_video['visibility'] == "v") {
211
+                                                    $status = "Approved";
212
+                                                } else if($_video['visibility'] == "n") {
213
+                                                    $status = "Approved";
214
+                                                } else if($_video['visibility'] == "o") {
215
+                                                    $status = "Disapproved";
216
+                                                } else {
217
+                                                    $status = "Unknown";
218
+                                                }                      
219 219
 												
220
-												if($_video['commenting'] == "a") 
221
-													$_video['commentstatus'] = "Commenting allowed";
222
-												else 
223
-													$_video['commentstatus'] = "Commenting disallowed";
220
+                                                if($_video['commenting'] == "a") 
221
+                                                    $_video['commentstatus'] = "Commenting allowed";
222
+                                                else 
223
+                                                    $_video['commentstatus'] = "Commenting disallowed";
224 224
                                     ?> 
225 225
                                     <tr style="margin-top: 5px;" id="videoslist">
226 226
                                         <td class="video-manager-left">
Please login to merge, or discard this patch.