Completed
Push — master ( 6b5c10...3d94b7 )
by Angus
08:54
created
application/views/ReportIssue.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 		<?=form_input($form_url)?>
11 11
 	</div>
12 12
 
13
-	<?=form_input('website','', ['id' => 'website'])?>
13
+	<?=form_input('website', '', ['id' => 'website'])?>
14 14
 
15 15
 	<?=validation_errors()?><?=($issue_submitted ? "Issue successfully submitted" : "")?>
16 16
 	<button type="submit" class="btn btn-primary">Submit</button> | Alternatively, post an issue on our <?=anchor('https://github.com/DakuTree/manga-tracker/issues/new', 'Github page')?>.
Please login to merge, or discard this patch.
application/controllers/ReportIssue.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 		$this->header_data['page']  = "report-issue";
13 13
 
14 14
 		$this->form_validation->set_rules('issue_description', 'Description', 'required|max_length[255]');
15
-		$this->form_validation->set_rules('issue_url',         'URL',         'valid_url');
15
+		$this->form_validation->set_rules('issue_url', 'URL', 'valid_url');
16 16
 
17 17
 
18 18
 		$this->body_data['issue_submitted'] = FALSE;
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
 
22 22
 			if(!empty($this->input->post('website'))) {
23 23
 				$this->body_data['issue_submitted'] = FALSE;
24
-				log_message('error',"Bot attempting to spam report issue form: \"".$this->input->post('issue_description')."\"");
24
+				log_message('error', "Bot attempting to spam report issue form: \"".$this->input->post('issue_description')."\"");
25 25
 			} else {
26
-				$this->body_data['issue_submitted'] = $this->Tracker->issue->report("USERID:" . $this->User->id . " ||| " . $this->input->post('issue_description'), NULL, $this->input->post('issue_url'));
26
+				$this->body_data['issue_submitted'] = $this->Tracker->issue->report("USERID:".$this->User->id." ||| ".$this->input->post('issue_description'), NULL, $this->input->post('issue_url'));
27 27
 			}
28 28
 		}
29 29
 
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Admin_Model.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed');
2 2
 
3 3
 class Tracker_Admin_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		$query = $query->get();
78 78
 
79 79
 		if($query->num_rows() > 0) {
80
-			foreach ($query->result() as $row) {
80
+			foreach($query->result() as $row) {
81 81
 				$this->handleUpdate($row);
82 82
 			}
83 83
 		}
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 		$query = $query->get();
135 135
 
136 136
 		if($query->num_rows() > 0) {
137
-			foreach ($query->result() as $row) {
137
+			foreach($query->result() as $row) {
138 138
 				$this->handleUpdate($row);
139 139
 			}
140 140
 		}
@@ -209,10 +209,10 @@  discard block
 block discarded – undo
209 209
 		                  ->get();
210 210
 
211 211
 		$sites = $query->result_array();
212
-		foreach ($sites as $site) {
212
+		foreach($sites as $site) {
213 213
 			$siteClass = $this->sites->{$site['site_class']};
214 214
 			if($titleDataList = $siteClass->doCustomUpdate()) {
215
-				foreach ($titleDataList as $titleURL => $titleData) {
215
+				foreach($titleDataList as $titleURL => $titleData) {
216 216
 					$titleURL = (string) $titleURL; //Number only keys get converted to int for some reason, so we need to fix that.
217 217
 					print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong
218 218
 					if(is_array($titleData) && !is_null($titleData['latest_chapter'])) {
@@ -255,7 +255,7 @@  discard block
 block discarded – undo
255 255
 		$query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class')
256 256
 		                  ->from('tracker_titles')
257 257
 		                  ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left')
258
-		                  ->where('tracker_titles.followed','N')
258
+		                  ->where('tracker_titles.followed', 'N')
259 259
 		                  ->where('tracker_titles !=', '255')
260 260
 		                  ->where('tracker_sites.status', 'enabled')
261 261
 		                  ->where('tracker_sites.use_custom', 'Y')
Please login to merge, or discard this patch.
application/config/constants.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 | always be used to set the mode correctly.
27 27
 |
28 28
 */
29
-defined('FILE_READ_MODE')  OR define('FILE_READ_MODE', 0644);
29
+defined('FILE_READ_MODE') OR define('FILE_READ_MODE', 0644);
30 30
 defined('FILE_WRITE_MODE') OR define('FILE_WRITE_MODE', 0666);
31
-defined('DIR_READ_MODE')   OR define('DIR_READ_MODE', 0755);
32
-defined('DIR_WRITE_MODE')  OR define('DIR_WRITE_MODE', 0755);
31
+defined('DIR_READ_MODE') OR define('DIR_READ_MODE', 0755);
32
+defined('DIR_WRITE_MODE') OR define('DIR_WRITE_MODE', 0755);
33 33
 
34 34
 /*
35 35
 |--------------------------------------------------------------------------
@@ -39,14 +39,14 @@  discard block
 block discarded – undo
39 39
 | These modes are used when working with fopen()/popen()
40 40
 |
41 41
 */
42
-defined('FOPEN_READ')                           OR define('FOPEN_READ', 'rb');
43
-defined('FOPEN_READ_WRITE')                     OR define('FOPEN_READ_WRITE', 'r+b');
44
-defined('FOPEN_WRITE_CREATE_DESTRUCTIVE')       OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
42
+defined('FOPEN_READ') OR define('FOPEN_READ', 'rb');
43
+defined('FOPEN_READ_WRITE') OR define('FOPEN_READ_WRITE', 'r+b');
44
+defined('FOPEN_WRITE_CREATE_DESTRUCTIVE') OR define('FOPEN_WRITE_CREATE_DESTRUCTIVE', 'wb'); // truncates existing file data, use with care
45 45
 defined('FOPEN_READ_WRITE_CREATE_DESCTRUCTIVE') OR define('FOPEN_READ_WRITE_CREATE_DESTRUCTIVE', 'w+b'); // truncates existing file data, use with care
46
-defined('FOPEN_WRITE_CREATE')                   OR define('FOPEN_WRITE_CREATE', 'ab');
47
-defined('FOPEN_READ_WRITE_CREATE')              OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
48
-defined('FOPEN_WRITE_CREATE_STRICT')            OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
49
-defined('FOPEN_READ_WRITE_CREATE_STRICT')       OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
46
+defined('FOPEN_WRITE_CREATE') OR define('FOPEN_WRITE_CREATE', 'ab');
47
+defined('FOPEN_READ_WRITE_CREATE') OR define('FOPEN_READ_WRITE_CREATE', 'a+b');
48
+defined('FOPEN_WRITE_CREATE_STRICT') OR define('FOPEN_WRITE_CREATE_STRICT', 'xb');
49
+defined('FOPEN_READ_WRITE_CREATE_STRICT') OR define('FOPEN_READ_WRITE_CREATE_STRICT', 'x+b');
50 50
 
51 51
 /*
52 52
 |--------------------------------------------------------------------------
@@ -73,20 +73,20 @@  discard block
 block discarded – undo
73 73
 |       http://tldp.org/LDP/abs/html/exitcodes.html
74 74
 |
75 75
 */
76
-defined('EXIT_SUCCESS')        OR define('EXIT_SUCCESS', 0); // no errors
77
-defined('EXIT_ERROR')          OR define('EXIT_ERROR', 1); // generic error
78
-defined('EXIT_CONFIG')         OR define('EXIT_CONFIG', 3); // configuration error
79
-defined('EXIT_UNKNOWN_FILE')   OR define('EXIT_UNKNOWN_FILE', 4); // file not found
80
-defined('EXIT_UNKNOWN_CLASS')  OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
76
+defined('EXIT_SUCCESS') OR define('EXIT_SUCCESS', 0); // no errors
77
+defined('EXIT_ERROR') OR define('EXIT_ERROR', 1); // generic error
78
+defined('EXIT_CONFIG') OR define('EXIT_CONFIG', 3); // configuration error
79
+defined('EXIT_UNKNOWN_FILE') OR define('EXIT_UNKNOWN_FILE', 4); // file not found
80
+defined('EXIT_UNKNOWN_CLASS') OR define('EXIT_UNKNOWN_CLASS', 5); // unknown class
81 81
 defined('EXIT_UNKNOWN_METHOD') OR define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
82
-defined('EXIT_USER_INPUT')     OR define('EXIT_USER_INPUT', 7); // invalid user input
83
-defined('EXIT_DATABASE')       OR define('EXIT_DATABASE', 8); // database error
84
-defined('EXIT__AUTO_MIN')      OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85
-defined('EXIT__AUTO_MAX')      OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
82
+defined('EXIT_USER_INPUT') OR define('EXIT_USER_INPUT', 7); // invalid user input
83
+defined('EXIT_DATABASE') OR define('EXIT_DATABASE', 8); // database error
84
+defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
85
+defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
86 86
 
87 87
 /***** TIMEAGO CONSTANTS *****/
88 88
 defined('TIMEAGO_MONTH') OR define('TIMEAGO_MONTH', strtotime('-1 month')); //1 month ago
89
-defined('TIMEAGO_WEEK')  OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago
90
-defined('TIMEAGO_3DAY')  OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago
89
+defined('TIMEAGO_WEEK') OR define('TIMEAGO_WEEK', strtotime('-1 week')); //1 week ago
90
+defined('TIMEAGO_3DAY') OR define('TIMEAGO_3DAY', strtotime('-3 day')); //3 days ago
91 91
 
92 92
 defined('USERSCRIPT_VERSION') OR define('USERSCRIPT_VERSION', '1.10.22'); //This is automatically set by a PHPStorm File Watcher
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Sites_Model.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php declare(strict_types = 1); defined('BASEPATH') OR exit('No direct script access allowed');
2 2
 
3 3
 /**
4 4
  * Class Tracker_Sites_Model
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 
182 182
 			$ch = curl_init();
183 183
 			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
184
-			curl_setopt($ch, CURLOPT_ENCODING , "gzip");
184
+			curl_setopt($ch, CURLOPT_ENCODING, "gzip");
185 185
 			//curl_setopt($ch, CURLOPT_VERBOSE, 1);
186 186
 			curl_setopt($ch, CURLOPT_HEADER, 1);
187 187
 
@@ -203,8 +203,8 @@  discard block
 block discarded – undo
203 203
 			curl_setopt($ch, CURLOPT_URL, $url);
204 204
 
205 205
 			if($isPost) {
206
-				curl_setopt($ch,CURLOPT_POST, count($postFields));
207
-				curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($postFields));
206
+				curl_setopt($ch, CURLOPT_POST, count($postFields));
207
+				curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postFields));
208 208
 			}
209 209
 
210 210
 			$response = curl_exec($ch);
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 			$result = shell_exec('python '.APPPATH.'../_scripts/get_cloudflare_cookie.py '.escapeshellarg(json_encode($urlData)));
252 252
 			$cookieData = json_decode($result, TRUE);
253 253
 
254
-			$this->cache->save("cloudflare_{$this->site}", $cookieData['cookies'],  31536000 /* 1 year, or until we renew it */);
254
+			$this->cache->save("cloudflare_{$this->site}", $cookieData['cookies'], 31536000 /* 1 year, or until we renew it */);
255 255
 			log_message('debug', "Saving CloudFlare Cookies for {$this->site}");
256 256
 
257 257
 			$refresh = TRUE;
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 
310 310
 				$dom = new DOMDocument();
311 311
 				libxml_use_internal_errors(TRUE);
312
-				$dom->loadHTML('<?xml encoding="utf-8" ?>' . $data);
312
+				$dom->loadHTML('<?xml encoding="utf-8" ?>'.$data);
313 313
 				libxml_use_internal_errors(FALSE);
314 314
 
315 315
 				$xpath = new DOMXPath($dom);
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 				if($nodes_title->length === 1) {
319 319
 					if($nodes_row->length === 1) {
320 320
 						$firstRow      = $nodes_row->item(0);
321
-						$nodes_latest  = $xpath->query($node_latest_string,  $firstRow);
321
+						$nodes_latest  = $xpath->query($node_latest_string, $firstRow);
322 322
 
323 323
 						if($node_chapter_string !== '') {
324 324
 							$nodes_chapter = $xpath->query($node_chapter_string, $firstRow);
@@ -534,7 +534,7 @@  discard block
 block discarded – undo
534 534
 	final private function _setSiteRateLimit(?int $rateLimit = NULL) : bool {
535 535
 		//We would just use increment(), but we can't set ttl with it...
536 536
 		$currentRateLimit = $rateLimit ?: $this->_getSiteRateLimit();
537
-		return $this->cache->save("{$this->site}_ratelimit", $currentRateLimit + 1,3600);
537
+		return $this->cache->save("{$this->site}_ratelimit", $currentRateLimit + 1, 3600);
538 538
 	}
539 539
 }
540 540
 
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 		$chapter_parts = explode('/', $chapter); //returns #LANG#/#VOLUME#/#CHAPTER#/#CHAPTER_EXTRA#(/#PAGE#/)
552 552
 		return [
553 553
 			'url'    => $this->getChapterURL($title_url, $chapter),
554
-			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
554
+			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '')."c{$chapter_parts[2]}".(isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
555 555
 		];
556 556
 	}
557 557
 	public function getChapterURL(string $title_url, string $chapter) : string {
@@ -735,9 +735,9 @@  discard block
 block discarded – undo
735 735
 
736 736
 							$dateString = str_replace('/', '-', trim($nodes_latest->item(0)->nodeValue)); //NOTE: We replace slashes here as it stops strtotime interpreting the date as US date format.
737 737
 							if($dateString == 'T') {
738
-								$dateString = date("Y-m-d",now());
738
+								$dateString = date("Y-m-d", now());
739 739
 							}
740
-							$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString . ' 00:00'));
740
+							$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString.' 00:00'));
741 741
 
742 742
 							$titleDataList[$title_url] = $titleData;
743 743
 						}
@@ -901,11 +901,11 @@  discard block
 block discarded – undo
901 901
 			""
902 902
 		);
903 903
 		if($data) {
904
-			$titleData['title'] = trim(preg_replace('/ Added on .*$/','', $data['nodes_title']->textContent));
904
+			$titleData['title'] = trim(preg_replace('/ Added on .*$/', '', $data['nodes_title']->textContent));
905 905
 			$titleData['latest_chapter'] = preg_replace('/^.*\/([0-9\.]+)$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
906 906
 
907
-			$dateString = preg_replace('/^Added (?:on )?/', '',$data['nodes_latest']->textContent);
908
-			$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime($dateString));
907
+			$dateString = preg_replace('/^Added (?:on )?/', '', $data['nodes_latest']->textContent);
908
+			$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString));
909 909
 		}
910 910
 		return (!empty($titleData) ? $titleData : NULL);
911 911
 	}
Please login to merge, or discard this patch.