Passed
Push — dev ( 36ac9d...273395 )
by Darko
08:47
created
nntmux/Users.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -720,7 +720,7 @@  discard block
 block discarded – undo
720 720
 		$user = $this->getById($userID);
721 721
 		$secure_cookie = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? '1' : '0');
722 722
 		setcookie('uid', $userID, (time() + 2592000), '/', null, $secure_cookie, true);
723
-		setcookie('idh', ($this->hashSHA1($user['userseed'] . $userID)), (time() + 2592000), '/', null, $secure_cookie, true);	}
723
+		setcookie('idh', ($this->hashSHA1($user['userseed'] . $userID)), (time() + 2592000), '/', null, $secure_cookie, true); }
724 724
 
725 725
 	/**
726 726
 	 * Return the User ID of the user.
@@ -1139,7 +1139,7 @@  discard block
 block discarded – undo
1139 1139
 				$userID
1140 1140
 			)
1141 1141
 		);
1142
-		return ($value === false ? 0 : (int) $value['num']);
1142
+		return ($value === false ? 0 : (int)$value['num']);
1143 1143
 	}
1144 1144
 
1145 1145
 	public function getDownloadRequestsForUser($userID)
@@ -1205,7 +1205,7 @@  discard block
 block discarded – undo
1205 1205
 			)
1206 1206
 		);
1207 1207
 
1208
-		return ((integer)$result['role'] == (integer) $roleID) ? true : false;
1208
+		return ((integer)$result['role'] == (integer)$roleID) ? true : false;
1209 1209
 	}
1210 1210
 
1211 1211
 	/**
@@ -1215,7 +1215,7 @@  discard block
 block discarded – undo
1215 1215
 	 * @return bool
1216 1216
 	 */
1217 1217
 	public function isAdmin($userID) {
1218
-		return $this->roleCheck(self::ROLE_ADMIN, (integer) $userID);
1218
+		return $this->roleCheck(self::ROLE_ADMIN, (integer)$userID);
1219 1219
 	}
1220 1220
 
1221 1221
 	/**
@@ -1225,6 +1225,6 @@  discard block
 block discarded – undo
1225 1225
 	 * @return bool
1226 1226
 	 */
1227 1227
 	public function isModerator($userId) {
1228
-		return $this->roleCheck(self::ROLE_MODERATOR, (integer) $userId);
1228
+		return $this->roleCheck(self::ROLE_MODERATOR, (integer)$userId);
1229 1229
 	}
1230 1230
 }
Please login to merge, or discard this patch.
nntmux/Releases.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
 			true, NN_CACHE_EXPIRY_LONG
280 280
 		);
281 281
 		switch ((isset($setting[0]['value']) && is_numeric($setting[0]['value']) ? $setting[0]['value'] : 10)) {
282
-			case 0: // Hide releases with a password or a potential password (Hide unprocessed releases).
282
+			case 0 : // Hide releases with a password or a potential password (Hide unprocessed releases).
283 283
 				return ('= ' . Releases::PASSWD_NONE);
284 284
 			case 1: // Show releases with no password or a potential password (Show unprocessed releases).
285 285
 				return ('<= ' . Releases::PASSWD_POTENTIAL);
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
 		if (!empty($name) && $showSql === '') {
1058 1058
 			if (!empty($series) && (int)$series < 1900) {
1059 1059
 				$name .= sprintf(' S%s', str_pad($series, 2, '0', STR_PAD_LEFT));
1060
-				if (!empty($episode)  && strpos($episode, '/') === false) {
1060
+				if (!empty($episode) && strpos($episode, '/') === false) {
1061 1061
 					$name .= sprintf('E%s', str_pad($episode, 2, '0', STR_PAD_LEFT));
1062 1062
 				}
1063 1063
 			} else if (!empty($airdate)) {
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
 			FROM releases r
1648 1648
 			INNER JOIN musicinfo m ON r.musicinfo_id = m.id
1649 1649
 			WHERE r.categories_id BETWEEN " . Category::MUSIC_ROOT . " AND " . Category::MUSIC_OTHER . "
1650
-			AND r.categories_id != " . Category::MUSIC_AUDIOBOOK ."
1650
+			AND r.categories_id != " . Category::MUSIC_AUDIOBOOK . "
1651 1651
 			AND m.id > 0
1652 1652
 			AND m.cover > 0
1653 1653
 			AND r.id in (select max(id) from releases where musicinfo_id > 0 group by musicinfo_id)
@@ -1670,7 +1670,7 @@  discard block
 block discarded – undo
1670 1670
 			FROM releases r
1671 1671
 			INNER JOIN bookinfo b ON r.bookinfo_id = b.id
1672 1672
 			WHERE r.categories_id BETWEEN " . Category::BOOKS_ROOT . " AND " . Category::BOOKS_UNKNOWN . "
1673
-			OR r.categories_id = " . Category::MUSIC_AUDIOBOOK ."
1673
+			OR r.categories_id = " . Category::MUSIC_AUDIOBOOK . "
1674 1674
 			AND b.id > 0
1675 1675
 			AND b.cover > 0
1676 1676
 			AND r.id in (select max(id) from releases where bookinfo_id > 0 group by bookinfo_id)
Please login to merge, or discard this patch.
nntmux/Steam.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
 			$totaldetails = count($textarr) - 1;
137 137
 			for ($i = 0; $i <= $totaldetails;) {
138 138
 				if ($textarr[$i] == "Release Date") {
139
-					$pregmatchdate = $textarr[$i+1];
139
+					$pregmatchdate = $textarr[$i + 1];
140 140
 					if (preg_match_all('#(?P<day>[0-3]?\d)[^\d]|(?P<month>Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)|(?P<year>(19|20)\d{2})#i',
141 141
 						$pregmatchdate,
142 142
 						$matches)) {
@@ -151,8 +151,8 @@  discard block
 block discarded – undo
151 151
 						}
152 152
 					}
153 153
 				}
154
-				$this->_res['gamedetails'][$textarr[$i]] = $textarr[$i+1];
155
-				$i = $i+2;
154
+				$this->_res['gamedetails'][$textarr[$i]] = $textarr[$i + 1];
155
+				$i = $i + 2;
156 156
 			}
157 157
 		}
158 158
 
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
 		}
218 218
 		if ($this->_ret = $this->_html->find("div.screenshot_holder", 0)) {
219 219
 			if ($this->_ret = $this->_ret->find("a", 0)) {
220
-				if(preg_match('/\?url\=(?<imgurl>.*)/', $this->_ret->href, $matches)){
220
+				if (preg_match('/\?url\=(?<imgurl>.*)/', $this->_ret->href, $matches)) {
221 221
 					$this->_res['backdrop'] = trim($matches['imgurl']);
222
-				}else{
222
+				} else {
223 223
 					$this->_res['backdrop'] = trim($this->_ret->href);
224 224
 				}
225 225
 
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
 	{
331 331
 		if (isset($this->cookie)) {
332 332
 			$this->extractCookies(file_get_contents($this->cookie));
333
-			if($this->_ageCheckSet === false) {
333
+			if ($this->_ageCheckSet === false) {
334 334
 				$this->_postParams = array(
335 335
 					"snr" => "1_agecheck_agecheck__age-gate",
336 336
 					"ageDay" => "1",
Please login to merge, or discard this patch.
nntmux/libraries/Forking.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -504,7 +504,7 @@
 block discarded – undo
504 504
 			$threads = 1;
505 505
 		}
506 506
 
507
-		$leftguids = ['0','1','2','3','4','5','6','7','8','9','a','b','c','d','e','f'];
507
+		$leftguids = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
508 508
 
509 509
 		// Prevent PreDB FT from always running
510 510
 		if ($this->workTypeOptions[0] === 'predbft') {
Please login to merge, or discard this patch.
nntmux/libraries/TraktAPI.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@
 block discarded – undo
56 56
 	 */
57 57
 	public function episodeSummary($id, $season = '', $ep = '', $type = 'min')
58 58
 	{
59
-		switch($type) {
59
+		switch ($type) {
60 60
 			case 'aliases':
61 61
 			case 'full':
62 62
 			case 'images':
Please login to merge, or discard this patch.
nntmux/libraries/ForkingImportNZB.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	public function start($folder, $maxProcesses, $deleteComplete, $deleteFailed, $useFileName, $maxPerProcess)
40 40
 	{
41 41
 		$startTime = microtime(true);
42
-		$directories = glob($folder . '/*' , GLOB_ONLYDIR);
42
+		$directories = glob($folder . '/*', GLOB_ONLYDIR);
43 43
 
44 44
 		$this->_workCount = count($directories);
45 45
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	{
81 81
 		foreach ($directories as $directory) {
82 82
 			$this->_executeCommand(
83
-				$this->importPath  . '"' .
83
+				$this->importPath . '"' .
84 84
 				$directory . '" ' .
85 85
 				$this->deleteComplete . ' ' .
86 86
 				$this->deleteFailed . ' ' .
Please login to merge, or discard this patch.
nntmux/utility/Versions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,10 +12,10 @@
 block discarded – undo
12 12
 	/**
13 13
 	 * These constants are bitwise for checking what was changed.
14 14
 	 */
15
-	const UPDATED_GIT_COMMIT	= 1;
16
-	const UPDATED_GIT_TAG		= 2;
17
-	const UPDATED_SQL_DB_PATCH	= 4;
18
-	const UPDATED_SQL_FILE_LAST	= 8;
15
+	const UPDATED_GIT_COMMIT = 1;
16
+	const UPDATED_GIT_TAG = 2;
17
+	const UPDATED_SQL_DB_PATCH = 4;
18
+	const UPDATED_SQL_FILE_LAST = 8;
19 19
 
20 20
 	/**
21 21
 	 * @var \nntmux\utility\Git instance variable.
Please login to merge, or discard this patch.
nntmux/utility/Utility.php 1 patch
Spacing   +19 added lines, -21 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 			if ($path !== '') {
37 37
 				$fullPath .= $path . DS;
38 38
 				if (!is_readable($fullPath) || !is_executable($fullPath)) {
39
-					return "The '$fullPath' directory must be readable and executable by all ." .PHP_EOL;
39
+					return "The '$fullPath' directory must be readable and executable by all ." . PHP_EOL;
40 40
 				}
41 41
 			}
42 42
 		}
@@ -437,16 +437,16 @@  discard block
 block discarded – undo
437 437
 	public static function getUrl(array $options = [])
438 438
 	{
439 439
 		$defaults = [
440
-			'url'            => '',    // String ; The URL to download.
440
+			'url'            => '', // String ; The URL to download.
441 441
 			'method'         => 'get', // String ; Http method, get/post/etc..
442
-			'postdata'       => '',    // String ; Data to send on post method.
443
-			'language'       => '',    // String ; Language in request header string.
442
+			'postdata'       => '', // String ; Data to send on post method.
443
+			'language'       => '', // String ; Language in request header string.
444 444
 			'debug'          => false, // Bool   ; Show curl debug information.
445
-			'useragent'      => '',    // String ; User agent string.
446
-			'cookie'         => '',    // String ; Cookie string.
447
-			'requestheaders' => [],    // Array  ; List of request headers.
445
+			'useragent'      => '', // String ; User agent string.
446
+			'cookie'         => '', // String ; Cookie string.
447
+			'requestheaders' => [], // Array  ; List of request headers.
448 448
 			//          Example: ["Content-Type: application/json", "DNT: 1"]
449
-			'verifycert'     => true,  // Bool   ; Verify certificate authenticity?
449
+			'verifycert'     => true, // Bool   ; Verify certificate authenticity?
450 450
 			//          Since curl does not have a verify self signed certs option,
451 451
 			//          you should use this instead if your cert is self signed.
452 452
 		];
@@ -560,8 +560,7 @@  discard block
 block discarded – undo
560 560
 			)
561 561
 		) {
562 562
 			$fileSpec = sprintf($fileSpecTemplate, $options['type'], $options['id'], $options['suffix']);
563
-			$fileSpec = file_exists(NN_COVERS . $fileSpec) ? $fileSpec :
564
-				sprintf($fileSpecTemplate, $options['type'], 'no', $options['suffix']);
563
+			$fileSpec = file_exists(NN_COVERS . $fileSpec) ? $fileSpec : sprintf($fileSpecTemplate, $options['type'], 'no', $options['suffix']);
565 564
 		}
566 565
 
567 566
 		return $fileSpec;
@@ -578,13 +577,13 @@  discard block
 block discarded – undo
578 577
 	 */
579 578
 	public static function xmlToArray(\SimpleXMLElement $xml, $options = []) {
580 579
 		$defaults = array(
581
-			'namespaceSeparator' => ':',//you may want this to be something other than a colon
582
-			'attributePrefix' => '@',   //to distinguish between attributes and nodes with the same name
583
-			'alwaysArray' => [],   //array of xml tag names which should always become arrays
584
-			'autoArray' => true,        //only create arrays for tags which appear more than once
585
-			'textContent' => '$',       //key used for the text content of elements
586
-			'autoText' => true,         //skip textContent key if node has no attributes or child nodes
587
-			'keySearch' => false,       //optional search and replace on tag and attribute names
580
+			'namespaceSeparator' => ':', //you may want this to be something other than a colon
581
+			'attributePrefix' => '@', //to distinguish between attributes and nodes with the same name
582
+			'alwaysArray' => [], //array of xml tag names which should always become arrays
583
+			'autoArray' => true, //only create arrays for tags which appear more than once
584
+			'textContent' => '$', //key used for the text content of elements
585
+			'autoText' => true, //skip textContent key if node has no attributes or child nodes
586
+			'keySearch' => false, //optional search and replace on tag and attribute names
588 587
 			'keyReplace' => false       //replace values for above search values (as passed to str_replace())
589 588
 		);
590 589
 		$options = array_merge($defaults, $options);
@@ -897,8 +896,7 @@  discard block
 block discarded – undo
897 896
 
898 897
 	public static function generateUuid()
899 898
 	{
900
-		$key = sprintf
901
-		(
899
+		$key = sprintf(
902 900
 			'%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
903 901
 			// 32 bits for "time_low"
904 902
 			mt_rand(0, 0xffff), mt_rand(0, 0xffff),
@@ -1085,9 +1083,9 @@  discard block
 block discarded – undo
1085 1083
 
1086 1084
 		$response =
1087 1085
 			"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" .
1088
-			'<error code="' . $errorCode .  '" description="' . $errorText . "\"/>\n";
1086
+			'<error code="' . $errorCode . '" description="' . $errorText . "\"/>\n";
1089 1087
 		header('Content-type: text/xml');
1090
-		header('Content-Length: ' . strlen($response) );
1088
+		header('Content-Length: ' . strlen($response));
1091 1089
 		header('X-NNTmux: API ERROR [' . $errorCode . '] ' . $errorText);
1092 1090
 
1093 1091
 		exit($response);
Please login to merge, or discard this patch.
nntmux/XXX.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
 				$order[1]
248 248
 		);
249 249
 		$return = $this->pdo->query($sql, true, NN_CACHE_EXPIRY_MEDIUM);
250
-		if (!empty($return)){
250
+		if (!empty($return)) {
251 251
 			$return[0]['_totalcount'] = (isset($xxxmovies['total']) ? $xxxmovies['total'] : 0);
252 252
 		}
253 253
 		return $return;
@@ -330,8 +330,8 @@  discard block
 block discarded – undo
330 330
 			if (trim($ta) == '') {
331 331
 				continue;
332 332
 			}
333
-			if ($field == "genre" ) {
334
-				$ta = $this->getGenres(true,$ta);
333
+			if ($field == "genre") {
334
+				$ta = $this->getGenres(true, $ta);
335 335
 				$ta = $ta["title"];
336 336
 			}
337 337
 			if ($i > 7) {
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 
411 411
 		if ($iafd->findme() !== false) {
412 412
 
413
-			switch($iafd->classUsed) {
413
+			switch ($iafd->classUsed) {
414 414
 				case "ade":
415 415
 					$mov = new ADE();
416 416
 					$mov->directLink = (string)$iafd->directUrl;
@@ -503,22 +503,22 @@  discard block
 block discarded – undo
503 503
 		$mov['directurl'] = html_entity_decode($res['directurl'], ENT_QUOTES, 'UTF-8');
504 504
 		$mov['classused'] = $this->whichclass;
505 505
 
506
-		$check = $this->pdo->queryOneRow(sprintf('SELECT id FROM xxxinfo WHERE title = %s',	$this->pdo->escapeString($mov['title'])));
506
+		$check = $this->pdo->queryOneRow(sprintf('SELECT id FROM xxxinfo WHERE title = %s', $this->pdo->escapeString($mov['title'])));
507 507
 		$xxxID = 0;
508
-		if(isset($check['id'])){
508
+		if (isset($check['id'])) {
509 509
 			$xxxID = $check['id'];
510 510
 		}
511 511
 
512
-		if($check === false || $xxxID > 0){
512
+		if ($check === false || $xxxID > 0) {
513 513
 
514 514
 			// Update Current XXX Information - getXXXCovers.php
515
-			if($xxxID > 0){
515
+			if ($xxxID > 0) {
516 516
 				$this->update($check['id'], $mov['title'], $mov['tagline'], $mov['plot'], $mov['genre'], $mov['director'], $mov['actors'], $mov['extras'], $mov['productinfo'], $mov['trailers'], $mov['directurl'], $mov['classused']);
517 517
 				$xxxID = $check['id'];
518 518
 			}
519 519
 
520 520
 			// Insert New XXX Information
521
-			if($check === false){
521
+			if ($check === false) {
522 522
 				$xxxID = $this->pdo->queryInsert(
523 523
 					sprintf("
524 524
 					INSERT INTO xxxinfo
@@ -636,7 +636,7 @@  discard block
 block discarded – undo
636 636
 	 */
637 637
 	protected function checkXXXInfoExists($releaseName)
638 638
 	{
639
-		return $this->pdo->queryOneRow(sprintf("SELECT id, title FROM xxxinfo WHERE title LIKE %s", "'". $releaseName . "%'"));
639
+		return $this->pdo->queryOneRow(sprintf("SELECT id, title FROM xxxinfo WHERE title LIKE %s", "'" . $releaseName . "%'"));
640 640
 	}
641 641
 
642 642
 	/**
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
 			$name = trim(preg_replace('/(brazilian|chinese|croatian|danish|deutsch|dutch|estonian|flemish|finnish|french|german|greek|hebrew|icelandic|italian|latin|nordic|norwegian|polish|portuguese|japenese|japanese|russian|serbian|slovenian|spanish|spanisch|swedish|thai|turkish)$/i', '', $name));
671 671
 
672 672
 			// Check if the name is long enough and not just numbers and not file (d) of (d) and does not contain Episodes and any dated 00.00.00 which are site rips..
673
-			if (strlen($name) > 5 && !preg_match('/^\d+$/', $name) && !preg_match('/( File \d+ of \d+|\d+.\d+.\d+)/',$name) && !preg_match('/(E\d+)/',$name) && !preg_match('/\d\d\.\d\d.\d\d/', $name)) {
673
+			if (strlen($name) > 5 && !preg_match('/^\d+$/', $name) && !preg_match('/( File \d+ of \d+|\d+.\d+.\d+)/', $name) && !preg_match('/(E\d+)/', $name) && !preg_match('/\d\d\.\d\d.\d\d/', $name)) {
674 674
 				$this->currentTitle = $name;
675 675
 				return true;
676 676
 			} else {
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
 			}
757 757
 		}
758 758
 
759
-		$ret = ltrim($ret,",");
759
+		$ret = ltrim($ret, ",");
760 760
 		return ($ret);
761 761
 	}
762 762
 
@@ -790,7 +790,7 @@  discard block
 block discarded – undo
790 790
 		if ($whichclass === "ade") {
791 791
 			if (!empty($res)) {
792 792
 				$trailers = unserialize($res);
793
-				$ret .="<object width='360' height='240' type='application/x-shockwave-flash' id='EmpireFlashPlayer' name='EmpireFlashPlayer' data='".	$trailers['url'] . "'>";
793
+				$ret .= "<object width='360' height='240' type='application/x-shockwave-flash' id='EmpireFlashPlayer' name='EmpireFlashPlayer' data='" . $trailers['url'] . "'>";
794 794
 				$ret .= "<param name='flashvars' value= 'streamID=" . $trailers['streamid'] . "&amp;autoPlay=false&amp;BaseStreamingUrl=" . $trailers['baseurl'] . "'>";
795 795
 				$ret .= "</object>";
796 796
 
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 			if (!empty($res)) {
802 802
 				$trailers = unserialize($res);
803 803
 				$ret .= "<embed id='trailer' width='480' height='360'";
804
-				$ret .= "flashvars='" .	$trailers['flashvars'] . "' allowfullscreen='true' allowscriptaccess='always' quality='high' name='trailer' style='undefined'";
804
+				$ret .= "flashvars='" . $trailers['flashvars'] . "' allowfullscreen='true' allowscriptaccess='always' quality='high' name='trailer' style='undefined'";
805 805
 				$ret .= "src='" . $trailers['baseurl'] . "' type='application/x-shockwave-flash'>";
806 806
 
807 807
 				return ($ret);
Please login to merge, or discard this patch.