Completed
Push — master ( dec28d...819745 )
by Angus
07:49
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.
_scripts/generate_spritesheet.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,11 +23,11 @@  discard block
 block discarded – undo
23 23
 		imagealphablending($sheetImage, FALSE);
24 24
 		imagesavealpha($sheetImage, TRUE);
25 25
 
26
-		imagefill($sheetImage,0,0,0x7fff0000);
26
+		imagefill($sheetImage, 0, 0, 0x7fff0000);
27 27
 
28 28
 		$x = 0;
29
-		foreach ($this->fileList as $filename) {
30
-			$siteImage = imagecreatefrompng(ICON_FOLDER. "/{$filename}");
29
+		foreach($this->fileList as $filename) {
30
+			$siteImage = imagecreatefrompng(ICON_FOLDER."/{$filename}");
31 31
 			imagealphablending($siteImage, TRUE);
32 32
 
33 33
 			$dst_x = ((16 + 2) * $x);
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		if(preg_match('/\.sprite-site.*\@cache-version: ([0-9]+);/s', $oldLESS, $cvMatches)) {
58 58
 			$cacheVersion = ((int) $cvMatches[1]) + 1;
59 59
 
60
-			$newLESS = preg_replace('/\.sprite-site.*/s', '',$oldLESS);
60
+			$newLESS = preg_replace('/\.sprite-site.*/s', '', $oldLESS);
61 61
 			$newLESS .= ''.
62 62
 				".sprite-site {\n".
63 63
 				"	.sprite();\n".
Please login to merge, or discard this patch.
_scripts/generate_foolslide.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 	private $className;
10 10
 
11 11
 	public function __construct() {
12
-		if(isset($_SERVER['argv']) && count($_SERVER['argv']) === 3){
12
+		if(isset($_SERVER['argv']) && count($_SERVER['argv']) === 3) {
13 13
 			$this->baseURL   = rtrim($_SERVER['argv'][1], '/');
14 14
 			$this->className = $_SERVER['argv'][2];
15 15
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 
30 30
 		$this->updateDocs();
31 31
 
32
-		$domain =  preg_replace('#^https?://(.*?)(?:/.*?)?$#', '$1', $this->baseURL);
32
+		$domain = preg_replace('#^https?://(.*?)(?:/.*?)?$#', '$1', $this->baseURL);
33 33
 		say("\nAdmin SQL:");
34 34
 		say("INSERT INTO `mangatracker_development`.`tracker_sites` (`id`, `site`, `site_class`, `status`, `use_custom`) VALUES (NULL, '{$domain}', '{$this->className}', 'enabled', 'Y');");
35 35
 		say("INSERT INTO `mangatracker_production`.`tracker_sites` (`id`, `site`, `site_class`, `status`, `use_custom`) VALUES (NULL, '{$domain}', '{$this->className}', 'enabled', 'Y');");
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
 
109 109
 		//Update @updated
110 110
 		$currentDate = date("Y-m-d", time());
111
-		$baseFile = str_replace("@updated      {$matches[1]}","@updated      {$currentDate}", $baseFile);
111
+		$baseFile = str_replace("@updated      {$matches[1]}", "@updated      {$currentDate}", $baseFile);
112 112
 
113 113
 		//Update @version
114 114
 		$currentVersion = explode('.', $matches[2]);
115
-		$newVersion = "{$currentVersion[0]}.{$currentVersion[1]}.". (((int) $currentVersion[2]) + 1);
116
-		$baseFile = str_replace("@version      {$matches[2]}","@version      {$newVersion}", $baseFile);
115
+		$newVersion = "{$currentVersion[0]}.{$currentVersion[1]}.".(((int) $currentVersion[2]) + 1);
116
+		$baseFile = str_replace("@version      {$matches[2]}", "@version      {$newVersion}", $baseFile);
117 117
 
118 118
 		//Add @require
119 119
 		// @resource     fontAwesome
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[1000]');
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_Model.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php declare(strict_types=1); defined('BASEPATH') OR exit('No direct script access allowed');
2 2
 
3 3
 include_once APPPATH.'models/Tracker/Tracker_Base_Model.php';
4
-foreach (glob(APPPATH.'models/Tracker/*.php') as $filename) {
4
+foreach(glob(APPPATH.'models/Tracker/*.php') as $filename) {
5 5
 	/** @noinspection PhpIncludeInspection */
6 6
 	include_once $filename;
7 7
 }
Please login to merge, or discard this patch.
application/models/User_Options_Model.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 			$query = $this->db->select('value_str, value_int')
201 201
 			                  ->from('user_options')
202 202
 			                  ->where('user_id', $userID)
203
-			                  ->where('name',    $option)
203
+			                  ->where('name', $option)
204 204
 			                  ->limit(1);
205 205
 			$data = $query->get()->row_array();
206 206
 		} else {
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
 				$query = $this->db->select('value_str, value_int')
209 209
 				                  ->from('user_options')
210 210
 				                  ->where('user_id', $userID)
211
-				                  ->where('name',    $option)
211
+				                  ->where('name', $option)
212 212
 				                  ->limit(1);
213 213
 				$data = $query->get()->row_array();
214 214
 				$this->session->set_tempdata("option_{$option}", $data, 3600);
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 			);
262 262
 			//FIXME: Get a better solution than str_replace for removing special characters
263 263
 			$elements = array();
264
-			foreach (array_values($this->options[$option]['valid_options']) as $valid_option) {
264
+			foreach(array_values($this->options[$option]['valid_options']) as $valid_option) {
265 265
 				$elements[$option.'_'.str_replace(',', '_', $valid_option)] = array_merge($base_attributes, array(
266 266
 					'value' => $valid_option
267 267
 				));
Please login to merge, or discard this patch.
application/models/History_Model.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 			foreach($result as $row) {
58 58
 				$arrRow = [];
59 59
 
60
-				$arrRow['updated_at']  = $row->updated_at;
60
+				$arrRow['updated_at'] = $row->updated_at;
61 61
 
62 62
 				$newChapterData = $this->Tracker->sites->{$row->site_class}->getChapterData($row->title_url, $row->new_chapter);
63 63
 				$arrRow['new_chapter']      = "<a href=\"{$newChapterData['url']}\">{$newChapterData['number']}</a>";
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Sites_Model.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
 
189 189
 			$ch = curl_init();
190 190
 			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
191
-			curl_setopt($ch, CURLOPT_ENCODING , "gzip");
191
+			curl_setopt($ch, CURLOPT_ENCODING, "gzip");
192 192
 			//curl_setopt($ch, CURLOPT_VERBOSE, 1);
193 193
 			curl_setopt($ch, CURLOPT_HEADER, 1);
194 194
 
@@ -210,8 +210,8 @@  discard block
 block discarded – undo
210 210
 			curl_setopt($ch, CURLOPT_URL, $url);
211 211
 
212 212
 			if($isPost) {
213
-				curl_setopt($ch,CURLOPT_POST, count($postFields));
214
-				curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($postFields));
213
+				curl_setopt($ch, CURLOPT_POST, count($postFields));
214
+				curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postFields));
215 215
 			}
216 216
 
217 217
 			$response = curl_exec($ch);
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 			$result = shell_exec('python '.APPPATH.'../_scripts/get_cloudflare_cookie.py '.escapeshellarg(json_encode($urlData)));
259 259
 			$cookieData = json_decode($result, TRUE);
260 260
 
261
-			$this->cache->save("cloudflare_{$this->site}", $cookieData['cookies'],  31536000 /* 1 year, or until we renew it */);
261
+			$this->cache->save("cloudflare_{$this->site}", $cookieData['cookies'], 31536000 /* 1 year, or until we renew it */);
262 262
 			log_message('debug', "Saving CloudFlare Cookies for {$this->site}");
263 263
 
264 264
 			$refresh = TRUE;
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
 
317 317
 				$dom = new DOMDocument();
318 318
 				libxml_use_internal_errors(TRUE);
319
-				$dom->loadHTML('<?xml encoding="utf-8" ?>' . $data);
319
+				$dom->loadHTML('<?xml encoding="utf-8" ?>'.$data);
320 320
 				libxml_use_internal_errors(FALSE);
321 321
 
322 322
 				$xpath = new DOMXPath($dom);
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
 				if($nodes_title->length === 1) {
326 326
 					if($nodes_row->length === 1) {
327 327
 						$firstRow      = $nodes_row->item(0);
328
-						$nodes_latest  = $xpath->query($node_latest_string,  $firstRow);
328
+						$nodes_latest  = $xpath->query($node_latest_string, $firstRow);
329 329
 
330 330
 						if($node_chapter_string !== '') {
331 331
 							$nodes_chapter = $xpath->query($node_chapter_string, $firstRow);
@@ -541,7 +541,7 @@  discard block
 block discarded – undo
541 541
 	final private function _setSiteRateLimit(?int $rateLimit = NULL) : bool {
542 542
 		//We would just use increment(), but we can't set ttl with it...
543 543
 		$currentRateLimit = $rateLimit ?: $this->_getSiteRateLimit();
544
-		return $this->cache->save("{$this->site}_ratelimit", $currentRateLimit + 1,3600);
544
+		return $this->cache->save("{$this->site}_ratelimit", $currentRateLimit + 1, 3600);
545 545
 	}
546 546
 }
547 547
 
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 		$chapter_parts = explode('/', $chapter); //returns #LANG#/#VOLUME#/#CHAPTER#/#CHAPTER_EXTRA#(/#PAGE#/)
559 559
 		return [
560 560
 			'url'    => $this->getChapterURL($title_url, $chapter),
561
-			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
561
+			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '')."c{$chapter_parts[2]}".(isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
562 562
 		];
563 563
 	}
564 564
 	public function getChapterURL(string $title_url, string $chapter) : string {
@@ -742,9 +742,9 @@  discard block
 block discarded – undo
742 742
 
743 743
 							$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.
744 744
 							if($dateString == 'T') {
745
-								$dateString = date("Y-m-d",now());
745
+								$dateString = date("Y-m-d", now());
746 746
 							}
747
-							$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString . ' 00:00'));
747
+							$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString.' 00:00'));
748 748
 
749 749
 							$titleDataList[$title_url] = $titleData;
750 750
 						}
@@ -908,11 +908,11 @@  discard block
 block discarded – undo
908 908
 			""
909 909
 		);
910 910
 		if($data) {
911
-			$titleData['title'] = trim(preg_replace('/ Added on .*$/','', $data['nodes_title']->textContent));
911
+			$titleData['title'] = trim(preg_replace('/ Added on .*$/', '', $data['nodes_title']->textContent));
912 912
 			$titleData['latest_chapter'] = preg_replace('/^.*\/([0-9\.]+)$/', '$1', (string) $data['nodes_chapter']->getAttribute('href'));
913 913
 
914
-			$dateString = preg_replace('/^Added (?:on )?/', '',$data['nodes_latest']->textContent);
915
-			$titleData['last_updated'] =  date("Y-m-d H:i:s", strtotime($dateString));
914
+			$dateString = preg_replace('/^Added (?:on )?/', '', $data['nodes_latest']->textContent);
915
+			$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString));
916 916
 		}
917 917
 		return (!empty($titleData) ? $titleData : NULL);
918 918
 	}
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Stats_Model.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 				], FALSE)
29 29
 				->from('tracker_chapters')
30 30
 				->join('tracker_titles', 'tracker_titles.id = tracker_chapters.title_id', 'left')
31
-				->join('tracker_sites','tracker_titles.site_id = tracker_sites.id', 'left')
31
+				->join('tracker_sites', 'tracker_titles.site_id = tracker_sites.id', 'left')
32 32
 				->where('tracker_sites.status', 'enabled')
33 33
 				->group_by('tracker_chapters.title_id')
34 34
 				->having('count > 1')
Please login to merge, or discard this patch.