Passed
Branch dev (a25f63)
by Darko
15:17
created
www/pages/getnzb.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 // Remove any suffixed id with .nzb which is added to help weblogging programs see nzb traffic.
40 40
 if (isset($_GET['id'])) {
41
-	$_GET['id'] = str_ireplace('.nzb','', $_GET['id']);
41
+	$_GET['id'] = str_ireplace('.nzb', '', $_GET['id']);
42 42
 }
43 43
 //
44 44
 // A hash of the users ip to record against the download
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 		}
83 83
 
84 84
 		header("Content-type: application/octet-stream");
85
-		header("Content-disposition: attachment; filename=" .  date("Ymdhis") . ".nzb.zip");
85
+		header("Content-disposition: attachment; filename=" . date("Ymdhis") . ".nzb.zip");
86 86
 		exit($zip);
87 87
 	} else {
88 88
 		$page->show404();
Please login to merge, or discard this patch.
www/pages/details.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -137,33 +137,33 @@
 block discarded – undo
137 137
 	$rf = new ReleaseFiles;
138 138
 	$releasefiles = $rf->get($data["id"]);
139 139
 
140
-	$page->smarty->assign('releasefiles',$releasefiles);
141
-	$page->smarty->assign('release',$data);
142
-	$page->smarty->assign('reVideo',$reVideo);
143
-	$page->smarty->assign('reAudio',$reAudio);
144
-	$page->smarty->assign('reSubs',$reSubs);
145
-	$page->smarty->assign('nfo',$nfo);
146
-	$page->smarty->assign('show',$showInfo);
147
-	$page->smarty->assign('movie',$mov);
140
+	$page->smarty->assign('releasefiles', $releasefiles);
141
+	$page->smarty->assign('release', $data);
142
+	$page->smarty->assign('reVideo', $reVideo);
143
+	$page->smarty->assign('reAudio', $reAudio);
144
+	$page->smarty->assign('reSubs', $reSubs);
145
+	$page->smarty->assign('nfo', $nfo);
146
+	$page->smarty->assign('show', $showInfo);
147
+	$page->smarty->assign('movie', $mov);
148 148
 	$page->smarty->assign('xxx', $xxx);
149
-	$page->smarty->assign('episode',$episodeArray);
150
-	$page->smarty->assign('anidb',$AniDBAPIArray);
151
-	$page->smarty->assign('music',$mus);
152
-	$page->smarty->assign('con',$con);
149
+	$page->smarty->assign('episode', $episodeArray);
150
+	$page->smarty->assign('anidb', $AniDBAPIArray);
151
+	$page->smarty->assign('music', $mus);
152
+	$page->smarty->assign('con', $con);
153 153
 	$page->smarty->assign('game', $game);
154
-	$page->smarty->assign('book',$book);
154
+	$page->smarty->assign('book', $book);
155 155
 	$page->smarty->assign('predb', $pre);
156
-	$page->smarty->assign('comments',$comments);
157
-	$page->smarty->assign('searchname',$releases->getSimilarName($data['searchname']));
156
+	$page->smarty->assign('comments', $comments);
157
+	$page->smarty->assign('searchname', $releases->getSimilarName($data['searchname']));
158 158
 	$page->smarty->assign('similars', $similars);
159
-	$page->smarty->assign('privateprofiles', ($page->settings->getSetting('privateprofiles') == 1) ? true : false );
159
+	$page->smarty->assign('privateprofiles', ($page->settings->getSetting('privateprofiles') == 1) ? true : false);
160 160
 	$page->smarty->assign('failed', $failed);
161 161
 	$page->smarty->assign('cpapi', $cpapi);
162 162
 	$page->smarty->assign('cpurl', $cpurl);
163 163
 
164 164
 	$page->meta_title = "View NZB";
165 165
 	$page->meta_keywords = "view,nzb,description,details";
166
-	$page->meta_description = "View NZB for".$data["searchname"] ;
166
+	$page->meta_description = "View NZB for" . $data["searchname"];
167 167
 
168 168
 	$page->content = $page->smarty->fetch('viewnzb.tpl');
169 169
 	$page->render();
Please login to merge, or discard this patch.
Braces   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -16,11 +16,11 @@  discard block
 block discarded – undo
16 16
 use nntmux\Books;
17 17
 use nntmux\PreDb;
18 18
 
19
-if (!$page->users->isLoggedIn())
19
+if (!$page->users->isLoggedIn()) {
20 20
 	$page->show403();
21
+}
21 22
 
22
-if (isset($_GET["id"]))
23
-{
23
+if (isset($_GET["id"])) {
24 24
 	$releases = new Releases(['Settings' => $page->settings]);
25 25
 	$rc = new ReleaseComments;
26 26
 	$re = new ReleaseExtra;
@@ -30,11 +30,13 @@  discard block
 block discarded – undo
30 30
 	$cpapi = $user['cp_api'];
31 31
 	$cpurl = $user['cp_url'];
32 32
 
33
-	if (!$data)
34
-		$page->show404();
33
+	if (!$data) {
34
+			$page->show404();
35
+	}
35 36
 
36
-	if ($page->isPostBack())
37
-		$rc->addComment($data["id"], $data["gid"], $_POST["txtAddComment"], $page->users->currentUserId(), $_SERVER['REMOTE_ADDR']);
37
+	if ($page->isPostBack()) {
38
+			$rc->addComment($data["id"], $data["gid"], $_POST["txtAddComment"], $page->users->currentUserId(), $_SERVER['REMOTE_ADDR']);
39
+	}
38 40
 
39 41
 	$nfo = $releases->getReleaseNfo($data["id"], true);
40 42
 	$reVideo = $re->getVideo($data["id"]);
@@ -53,8 +55,7 @@  discard block
 block discarded – undo
53 55
 	}
54 56
 
55 57
 	$episodeArray = '';
56
-	if ($data['episodeinfoid'] > 0)
57
-	{
58
+	if ($data['episodeinfoid'] > 0) {
58 59
 		$episode = new Episode();
59 60
 		$episodeArray = $episode->getEpisodeInfoByID($data['episodeinfoid']);
60 61
 	}
@@ -125,8 +126,7 @@  discard block
 block discarded – undo
125 126
 	}
126 127
 
127 128
 	$AniDBAPIArray = '';
128
-	if ($data["anidbid"] > 0)
129
-	{
129
+	if ($data["anidbid"] > 0) {
130 130
 		$AniDB = new AniDB(['Settings' => $releases->pdo]);
131 131
 		$AniDBAPIArray = $AniDB->getAnimeInfo($data["anidbid"]);
132 132
 	}
Please login to merge, or discard this patch.
www/pages/logout.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1 1
 <?php
2 2
 $page->users->logout();
3 3
 
4
-header("Location: ".WWW_TOP."/login");
4
+header("Location: " . WWW_TOP . "/login");
Please login to merge, or discard this patch.
www/pages/sendtosab.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -2,19 +2,23 @@
 block discarded – undo
2 2
 
3 3
 use nntmux\SABnzbd;
4 4
 
5
-if (!$page->users->isLoggedIn())
5
+if (!$page->users->isLoggedIn()) {
6 6
 	$page->show403();
7
+}
7 8
 
8
-if (empty($_GET["id"]))
9
+if (empty($_GET["id"])) {
9 10
 	$page->show404();
11
+}
10 12
 
11 13
 $sab = new SABnzbd($page);
12 14
 
13
-if (empty($sab->url))
15
+if (empty($sab->url)) {
14 16
 	$page->show404();
17
+}
15 18
 
16
-if (empty($sab->apikey))
19
+if (empty($sab->apikey)) {
17 20
 	$page->show404();
21
+}
18 22
 
19 23
 $guid = $_GET["id"];
20 24
 
Please login to merge, or discard this patch.
www/admin/ajax_binaryblacklist-list.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 // login check
8 8
 $admin = new AdminPage;
9
-$bin  = new Binaries();
9
+$bin = new Binaries();
10 10
 
11 11
 if (isset($_GET['action']) && $_GET['action'] == "2")
12 12
 {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@
 block discarded – undo
8 8
 $admin = new AdminPage;
9 9
 $bin  = new Binaries();
10 10
 
11
-if (isset($_GET['action']) && $_GET['action'] == "2")
12
-{
11
+if (isset($_GET['action']) && $_GET['action'] == "2") {
13 12
 		$id = (int)$_GET['bin_id'];
14 13
 		$bin->deleteBlacklist($id);
15 14
 		print "Blacklist $id deleted.";
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,5 +12,5 @@
 block discarded – undo
12 12
 {
13 13
 		$id = (int)$_GET['bin_id'];
14 14
 		$bin->deleteBlacklist($id);
15
-		print "Blacklist $id deleted.";
15
+		print "blacklist $id deleted.";
16 16
 }
Please login to merge, or discard this patch.
www/admin/anidb-delete.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -6,8 +6,7 @@
 block discarded – undo
6 6
 
7 7
 $page = new AdminPage();
8 8
 
9
-if (isset($_GET['id']))
10
-{
9
+if (isset($_GET['id'])) {
11 10
 	$AniDB = new AniDB();
12 11
 	$AniDB->deleteTitle($_GET['id']);
13 12
 }
Please login to merge, or discard this patch.
www/admin/movie-edit.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
 
24 24
 	switch($action)
25 25
 	{
26
-	    case 'submit':
27
-	    	$coverLoc = WWW_DIR."covers/movies/".$id.'-cover.jpg';
28
-	    	$backdropLoc = WWW_DIR."covers/movies/".$id.'-backdrop.jpg';
26
+		case 'submit':
27
+			$coverLoc = WWW_DIR."covers/movies/".$id.'-cover.jpg';
28
+			$backdropLoc = WWW_DIR."covers/movies/".$id.'-backdrop.jpg';
29 29
 
30 30
 			if($_FILES['cover']['size'] > 0)
31 31
 			{
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
 			]);
67 67
 
68 68
 			header("Location:".WWW_TOP."/movie-list.php");
69
-	        die();
70
-	    break;
71
-	    case 'view':
72
-	    default:
69
+			die();
70
+		break;
71
+		case 'view':
72
+		default:
73 73
 			$page->title = "Movie Edit";
74 74
 			$page->smarty->assign('movie', $mov);
75 75
 		break;
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,27 +21,27 @@  discard block
 block discarded – undo
21 21
 		$page->show404();
22 22
 	}
23 23
 
24
-	switch($action)
24
+	switch ($action)
25 25
 	{
26 26
 	    case 'submit':
27
-	    	$coverLoc = WWW_DIR."covers/movies/".$id.'-cover.jpg';
28
-	    	$backdropLoc = WWW_DIR."covers/movies/".$id.'-backdrop.jpg';
27
+	    	$coverLoc = WWW_DIR . "covers/movies/" . $id . '-cover.jpg';
28
+	    	$backdropLoc = WWW_DIR . "covers/movies/" . $id . '-backdrop.jpg';
29 29
 
30
-			if($_FILES['cover']['size'] > 0)
30
+			if ($_FILES['cover']['size'] > 0)
31 31
 			{
32 32
 				$tmpName = $_FILES['cover']['tmp_name'];
33 33
 				$file_info = getimagesize($tmpName);
34
-				if(!empty($file_info))
34
+				if (!empty($file_info))
35 35
 				{
36 36
 					move_uploaded_file($_FILES['cover']['tmp_name'], $coverLoc);
37 37
 				}
38 38
 			}
39 39
 
40
-			if($_FILES['backdrop']['size'] > 0)
40
+			if ($_FILES['backdrop']['size'] > 0)
41 41
 			{
42 42
 				$tmpName = $_FILES['backdrop']['tmp_name'];
43 43
 				$file_info = getimagesize($tmpName);
44
-				if(!empty($file_info))
44
+				if (!empty($file_info))
45 45
 				{
46 46
 					move_uploaded_file($_FILES['backdrop']['tmp_name'], $backdropLoc);
47 47
 				}
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 				'year'     => $_POST["year"]
66 66
 			]);
67 67
 
68
-			header("Location:".WWW_TOP."/movie-list.php");
68
+			header("Location:" . WWW_TOP . "/movie-list.php");
69 69
 	        die();
70 70
 	    break;
71 71
 	    case 'view':
Please login to merge, or discard this patch.
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -12,8 +12,7 @@  discard block
 block discarded – undo
12 12
 // set the current action
13 13
 $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view';
14 14
 
15
-if (isset($_REQUEST["id"]))
16
-{
15
+if (isset($_REQUEST["id"])) {
17 16
 	$id = $_REQUEST["id"];
18 17
 	$mov = $movie->getMovieInfo($id);
19 18
 
@@ -21,28 +20,23 @@  discard block
 block discarded – undo
21 20
 		$page->show404();
22 21
 	}
23 22
 
24
-	switch($action)
25
-	{
23
+	switch($action) {
26 24
 	    case 'submit':
27 25
 	    	$coverLoc = WWW_DIR."covers/movies/".$id.'-cover.jpg';
28 26
 	    	$backdropLoc = WWW_DIR."covers/movies/".$id.'-backdrop.jpg';
29 27
 
30
-			if($_FILES['cover']['size'] > 0)
31
-			{
28
+			if($_FILES['cover']['size'] > 0) {
32 29
 				$tmpName = $_FILES['cover']['tmp_name'];
33 30
 				$file_info = getimagesize($tmpName);
34
-				if(!empty($file_info))
35
-				{
31
+				if(!empty($file_info)) {
36 32
 					move_uploaded_file($_FILES['cover']['tmp_name'], $coverLoc);
37 33
 				}
38 34
 			}
39 35
 
40
-			if($_FILES['backdrop']['size'] > 0)
41
-			{
36
+			if($_FILES['backdrop']['size'] > 0) {
42 37
 				$tmpName = $_FILES['backdrop']['tmp_name'];
43 38
 				$file_info = getimagesize($tmpName);
44
-				if(!empty($file_info))
45
-				{
39
+				if(!empty($file_info)) {
46 40
 					move_uploaded_file($_FILES['backdrop']['tmp_name'], $backdropLoc);
47 41
 				}
48 42
 			}
Please login to merge, or discard this patch.
www/admin/show-edit.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,13 +4,12 @@
 block discarded – undo
4 4
 
5 5
 use nntmux\Videos;
6 6
 
7
-$page   = new AdminPage();
7
+$page = new AdminPage();
8 8
 $tv = new smartyTV(['Settings' => $page->settings]);
9 9
 $video = new Videos(['Settings' => $page->settings]);
10 10
 
11 11
 switch ((isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view')) {
12
-	case 'submit':
13
-		//TODO: Use a function that allows overwrites
12
+	case 'submit' : //TODO: Use a function that allows overwrites
14 13
 		//$tv->update($_POST["id"], $_POST["title"],$_POST["summary"], $_POST['countries_id']);
15 14
 
16 15
 		if (isset($_POST['from']) && !empty($_POST['from'])) {
Please login to merge, or discard this patch.
www/admin/game-edit.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
 		$page->show404();
22 22
 	}
23 23
 
24
-	switch($action) {
24
+	switch ($action) {
25 25
 		case 'submit':
26 26
 			$coverLoc = NN_COVERS . "games/" . $id . '.jpg';
27 27
 
28
-			if($_FILES['cover']['size'] > 0) {
28
+			if ($_FILES['cover']['size'] > 0) {
29 29
 				$tmpName = $_FILES['cover']['tmp_name'];
30 30
 				$file_info = getimagesize($tmpName);
31
-				if(!empty($file_info)) {
31
+				if (!empty($file_info)) {
32 32
 					move_uploaded_file($_FILES['cover']['tmp_name'], $coverLoc);
33 33
 				}
34 34
 			}
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
 			$games->update($id, $_POST["title"], $_POST['asin'], $_POST['url'], $_POST["publisher"], $_POST["releasedate"], $_POST["esrb"], $_POST["cover"], $_POST['trailerurl'], $_POST["genre"]);
40 40
 
41
-			header("Location:".WWW_TOP."/game-list.php");
41
+			header("Location:" . WWW_TOP . "/game-list.php");
42 42
 			die();
43 43
 		break;
44 44
 
Please login to merge, or discard this patch.