@@ -154,7 +154,7 @@ |
||
154 | 154 | $overallbitrate = $track['Overall_bit_rate']; |
155 | 155 | } |
156 | 156 | if (isset($track['Unique_ID'])) { |
157 | - if(preg_match('/\(0x(?P<hash>[0-9a-f]{32})\)/i', $track['Unique_ID'], $matches)){ |
|
157 | + if (preg_match('/\(0x(?P<hash>[0-9a-f]{32})\)/i', $track['Unique_ID'], $matches)) { |
|
158 | 158 | $uniqueid = $matches['hash']; |
159 | 159 | $this->addUID($releaseID, $uniqueid); |
160 | 160 | } |
@@ -154,7 +154,7 @@ |
||
154 | 154 | $overallbitrate = $track['Overall_bit_rate']; |
155 | 155 | } |
156 | 156 | if (isset($track['Unique_ID'])) { |
157 | - if(preg_match('/\(0x(?P<hash>[0-9a-f]{32})\)/i', $track['Unique_ID'], $matches)){ |
|
157 | + if(preg_match('/\(0x(?P<hash>[0-9a-f]{32})\)/i', $track['Unique_ID'], $matches)) { |
|
158 | 158 | $uniqueid = $matches['hash']; |
159 | 159 | $this->addUID($releaseID, $uniqueid); |
160 | 160 | } |
@@ -1026,8 +1026,8 @@ |
||
1026 | 1026 | |
1027 | 1027 | public function isXxxClipSD() |
1028 | 1028 | { |
1029 | - switch(true) { |
|
1030 | - case $this->checkPoster( '/oz@lot[.]com/i', $this->poster, Category::XXX_CLIPSD): |
|
1029 | + switch (true) { |
|
1030 | + case $this->checkPoster('/oz@lot[.]com/i', $this->poster, Category::XXX_CLIPSD): |
|
1031 | 1031 | return true; |
1032 | 1032 | case preg_match('/SDPORN/i', $this->releaseName): |
1033 | 1033 | $this->tmpCat = Category::XXX_CLIPSD; |
@@ -197,8 +197,7 @@ |
||
197 | 197 | !preg_match('/\.(apk|bat|bmp|cbr|cbz|cfg|css|csv|cue|db|dll|doc|epub|exe|gif|htm|ico|idx|ini' . |
198 | 198 | '|jpg|lit|log|m3u|mid|mobi|mp3|nib|nzb|odt|opf|otf|par|par2|pdf|psd|pps|png|ppt|r\d{2,4}' . |
199 | 199 | '|rar|sfv|srr|sub|srt|sql|rom|rtf|tif|torrent|ttf|txt|vb|vol\d+\+\d+|wps|xml|zip)/i', |
200 | - $subject)) |
|
201 | - { |
|
200 | + $subject)) { |
|
202 | 201 | $hiddenID = (string)$nzbcontents->segments->segment; |
203 | 202 | $hiddenNFO = true; |
204 | 203 | } |
@@ -106,8 +106,8 @@ |
||
106 | 106 | public function __construct(array $options = []) |
107 | 107 | { |
108 | 108 | $defaults = [ |
109 | - 'Browser' => false, // Was this started from the browser? |
|
110 | - 'Echo' => true, // Echo to CLI? |
|
109 | + 'Browser' => false, // Was this started from the browser? |
|
110 | + 'Echo' => true, // Echo to CLI? |
|
111 | 111 | 'Binaries' => null, |
112 | 112 | 'Categorize' => null, |
113 | 113 | 'NZB' => null, |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $this->rsstoken = $page->userdata['rsstoken']; |
89 | 89 | |
90 | 90 | if (!empty($page->userdata['nzbgeturl'])) { |
91 | - $this->url = $page->userdata['nzbgeturl']; |
|
91 | + $this->url = $page->userdata['nzbgeturl']; |
|
92 | 92 | $this->userName = (empty($page->userdata['nzbgetusername']) ? '' : $page->userdata['nzbgetusername']); |
93 | 93 | $this->password = (empty($page->userdata['nzbgetpassword']) ? '' : $page->userdata['nzbgetpassword']); |
94 | 94 | } |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | if ($xml) { |
382 | 382 | $retVal = []; |
383 | 383 | $i = 0; |
384 | - foreach($xml->params->param->value->array->data->value as $value) { |
|
384 | + foreach ($xml->params->param->value->array->data->value as $value) { |
|
385 | 385 | foreach ($value->struct->member as $member) { |
386 | 386 | $value = (array)$member->value; |
387 | 387 | $value = array_shift($value); |
@@ -410,7 +410,7 @@ discard block |
||
410 | 410 | if ($data) { |
411 | 411 | $xml = simplexml_load_string($data); |
412 | 412 | if ($xml) { |
413 | - foreach($xml->params->param->value->struct->member as $member) { |
|
413 | + foreach ($xml->params->param->value->struct->member as $member) { |
|
414 | 414 | $value = (array)$member->value; |
415 | 415 | $value = array_shift($value); |
416 | 416 | if (!is_object($value)) { |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | * |
433 | 433 | * @access public |
434 | 434 | */ |
435 | - public function verifyURL ($url) |
|
435 | + public function verifyURL($url) |
|
436 | 436 | { |
437 | 437 | if (preg_match('/(?P<protocol>https?):\/\/(?P<url>.+?)(:(?P<port>\d+\/)|\/)$/i', $url, $matches)) { |
438 | 438 | return |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | */ |
267 | 267 | public function showMemUsage($oldUsage = 0, $realUsage = false, $peak = false) |
268 | 268 | { |
269 | - $currentUsage = ($peak ? memory_get_peak_usage($realUsage) : memory_get_usage($realUsage)); |
|
269 | + $currentUsage = ($peak ? memory_get_peak_usage($realUsage) : memory_get_usage($realUsage)); |
|
270 | 270 | $actualUsage = ($oldUsage > 0 ? $currentUsage - $oldUsage : $currentUsage); |
271 | 271 | |
272 | 272 | $units = [ |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | $usage = getrusage(); |
314 | 314 | |
315 | 315 | return |
316 | - 'USR: ' . $this->formatTimeString($usage['ru_utime.tv_sec']) . |
|
316 | + 'USR: ' . $this->formatTimeString($usage['ru_utime.tv_sec']) . |
|
317 | 317 | ' SYS: ' . $this->formatTimeString($usage['ru_stime.tv_sec']) . |
318 | 318 | ' FAULTS: ' . $usage['ru_majflt'] . |
319 | 319 | ' SWAPS: ' . $usage['ru_nswap']; |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | if (!$this->isWindows) { |
334 | 334 | $string = ''; |
335 | 335 | // Fix for single digits (2) or single float (2.1). |
336 | - foreach(sys_getloadavg() as $load) { |
|
336 | + foreach (sys_getloadavg() as $load) { |
|
337 | 337 | $strLen = strlen($load); |
338 | 338 | if ($strLen === 1) { |
339 | 339 | $string .= $load . '.00,'; |
@@ -604,7 +604,7 @@ discard block |
||
604 | 604 | asort($logs); |
605 | 605 | |
606 | 606 | // Remove all new logs from array (all elements under the last 51 elements of the array). |
607 | - array_splice($logs, -$this->maxLogs+1); |
|
607 | + array_splice($logs, -$this->maxLogs + 1); |
|
608 | 608 | |
609 | 609 | // Delete all the logs left in the array. |
610 | 610 | array_map('unlink', $logs); |
@@ -697,11 +697,11 @@ discard block |
||
697 | 697 | $time .= '00H:'; |
698 | 698 | } |
699 | 699 | if ($seconds > 60) { |
700 | - $time .= str_pad(round((($seconds % 3600) / 60)), 2 , '0', STR_PAD_LEFT) . 'M:'; |
|
700 | + $time .= str_pad(round((($seconds % 3600) / 60)), 2, '0', STR_PAD_LEFT) . 'M:'; |
|
701 | 701 | } else { |
702 | 702 | $time .= '00M:'; |
703 | 703 | } |
704 | - $time .= str_pad($seconds % 60, 2 , '0', STR_PAD_LEFT) . 'S'; |
|
704 | + $time .= str_pad($seconds % 60, 2, '0', STR_PAD_LEFT) . 'S'; |
|
705 | 705 | return $time; |
706 | 706 | } |
707 | 707 |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | /** |
61 | 61 | * Settings key literals |
62 | 62 | */ |
63 | - const RECAPTCHA_SETTING_SITEKEY = 'recaptchapublickey'; |
|
64 | - const RECAPTCHA_SETTING_SECRETKEY = 'recaptchaprivatekey'; |
|
63 | + const RECAPTCHA_SETTING_SITEKEY = 'recaptchapublickey'; |
|
64 | + const RECAPTCHA_SETTING_SECRETKEY = 'recaptchaprivatekey'; |
|
65 | 65 | |
66 | 66 | /** |
67 | 67 | * Construct and decide whether to show the captcha or not. |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | $rc_error = 'ReCaptcha Failed: '; |
151 | 151 | |
152 | 152 | foreach ($codes as $c) { |
153 | - switch($c) { |
|
153 | + switch ($c) { |
|
154 | 154 | case self::RECAPTCHA_ERROR_MISSING_SECRET: |
155 | 155 | $rc_error .= 'Missing Secret Key'; |
156 | 156 | break; |
@@ -3,7 +3,8 @@ discard block |
||
3 | 3 | |
4 | 4 | use ReCaptcha\ReCaptcha; |
5 | 5 | |
6 | -class Captcha { |
|
6 | +class Captcha |
|
7 | +{ |
|
7 | 8 | /** |
8 | 9 | * Smarty $page |
9 | 10 | * |
@@ -69,7 +70,8 @@ discard block |
||
69 | 70 | * @note Passing $page by reference to setup smarty vars easily. |
70 | 71 | * @param \Page $page |
71 | 72 | */ |
72 | - public function __construct(&$page) { |
|
73 | + public function __construct(&$page) |
|
74 | + { |
|
73 | 75 | if (!$page instanceof \Page) { |
74 | 76 | throw new \InvalidArgumentException('Invalid Page variable provided'); |
75 | 77 | } |
@@ -99,7 +101,8 @@ discard block |
||
99 | 101 | * |
100 | 102 | * @return bool |
101 | 103 | */ |
102 | - public function shouldDisplay() { |
|
104 | + public function shouldDisplay() |
|
105 | + { |
|
103 | 106 | if ($this->_bootstrapCaptcha()) { |
104 | 107 | return true; |
105 | 108 | } |
@@ -112,7 +115,8 @@ discard block |
||
112 | 115 | * |
113 | 116 | * @return string |
114 | 117 | */ |
115 | - public function getError() { |
|
118 | + public function getError() |
|
119 | + { |
|
116 | 120 | return $this->error; |
117 | 121 | } |
118 | 122 | |
@@ -123,7 +127,8 @@ discard block |
||
123 | 127 | * @param string $ip |
124 | 128 | * @return bool |
125 | 129 | */ |
126 | - public function processCaptcha($response, $ip) { |
|
130 | + public function processCaptcha($response, $ip) |
|
131 | + { |
|
127 | 132 | if (isset($response[self::RECAPTCHA_POSTKEY])) { |
128 | 133 | $post_response = $response[self::RECAPTCHA_POSTKEY]; |
129 | 134 | } else { |
@@ -146,7 +151,8 @@ discard block |
||
146 | 151 | * |
147 | 152 | * @param array $codes |
148 | 153 | */ |
149 | - private function _handleErrors($codes) { |
|
154 | + private function _handleErrors($codes) |
|
155 | + { |
|
150 | 156 | $rc_error = 'ReCaptcha Failed: '; |
151 | 157 | |
152 | 158 | foreach ($codes as $c) { |
@@ -177,7 +183,8 @@ discard block |
||
177 | 183 | * |
178 | 184 | * @return bool |
179 | 185 | */ |
180 | - private function _bootstrapCaptcha() { |
|
186 | + private function _bootstrapCaptcha() |
|
187 | + { |
|
181 | 188 | if ($this->recaptcha instanceof ReCaptcha) { |
182 | 189 | return true; |
183 | 190 | } |
@@ -1213,7 +1213,7 @@ |
||
1213 | 1213 | $aMin = $data['first']; |
1214 | 1214 | $reallyOldArticle = $oldArticle = $articleTime = null; |
1215 | 1215 | |
1216 | - while(true) { |
|
1216 | + while (true) { |
|
1217 | 1217 | // Article exists outside of available range, this shouldn't happen |
1218 | 1218 | if ($wantedArticle <= $data['first'] || $wantedArticle >= $data['last']) { |
1219 | 1219 | break; |
@@ -64,8 +64,8 @@ |
||
64 | 64 | |
65 | 65 | const NFO_FAILED = -9; // We failed to get a NFO after admin set max retries. |
66 | 66 | const NFO_UNPROC = -1; // Release has not been processed yet. |
67 | - const NFO_NONFO = 0; // Release has no NFO. |
|
68 | - const NFO_FOUND = 1; // Release has an NFO. |
|
67 | + const NFO_NONFO = 0; // Release has no NFO. |
|
68 | + const NFO_FOUND = 1; // Release has an NFO. |
|
69 | 69 | |
70 | 70 | /** |
71 | 71 | * Default constructor. |
@@ -130,7 +130,8 @@ discard block |
||
130 | 130 | * |
131 | 131 | * @access public |
132 | 132 | */ |
133 | - public function isNFO(&$possibleNFO, $guid) { |
|
133 | + public function isNFO(&$possibleNFO, $guid) |
|
134 | + { |
|
134 | 135 | if ($possibleNFO === false) { |
135 | 136 | return false; |
136 | 137 | } |
@@ -141,8 +142,7 @@ discard block |
||
141 | 142 | $size > 11 && |
142 | 143 | !preg_match( |
143 | 144 | '/\A(\s*<\?xml|=newz\[NZB\]=|RIFF|\s*[RP]AR|.{0,10}(JFIF|matroska|ftyp|ID3))|;\s*Generated\s*by.*SF\w/i' |
144 | - , $possibleNFO)) |
|
145 | - { |
|
145 | + , $possibleNFO)) { |
|
146 | 146 | // File/GetId3 work with files, so save to disk. |
147 | 147 | $tmpPath = $this->tmpPath . $guid . '.nfo'; |
148 | 148 | file_put_contents($tmpPath, $possibleNFO); |
@@ -158,8 +158,7 @@ discard block |
||
158 | 158 | |
159 | 159 | // Or binary. |
160 | 160 | } else if (preg_match('/^(JPE?G|Parity|PNG|RAR|XML|(7-)?[Zz]ip)/', $result) || |
161 | - preg_match('/[\x00-\x08\x12-\x1F\x0B\x0E\x0F]/', $possibleNFO)) |
|
162 | - { |
|
161 | + preg_match('/[\x00-\x08\x12-\x1F\x0B\x0E\x0F]/', $possibleNFO)) { |
|
163 | 162 | @unlink($tmpPath); |
164 | 163 | return false; |
165 | 164 | } |