Completed
Pull Request — master (#285)
by
unknown
05:36
created
application/helpers/generic_helper.php 2 patches
Spacing   +11 added lines, -11 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
  * Checks if view file exists.
@@ -6,7 +6,7 @@  discard block
 block discarded – undo
6 6
  * @return bool
7 7
  */
8 8
 function view_exists(string $path) : bool {
9
-	return file_exists(APPPATH . "/views/{$path}.php");
9
+	return file_exists(APPPATH."/views/{$path}.php");
10 10
 }
11 11
 
12 12
 function get_time_class(string $time_string) : string {
@@ -32,19 +32,19 @@  discard block
 block discarded – undo
32 32
 	return $time_string;
33 33
 }
34 34
 
35
-if (!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/function.http-parse-headers.php#112917
36
-	function http_parse_headers (string $raw_headers) : array {
35
+if(!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/function.http-parse-headers.php#112917
36
+	function http_parse_headers(string $raw_headers) : array {
37 37
 		$headers = array(); // $headers = [];
38
-		foreach (explode("\n", $raw_headers) as $i => $h) {
38
+		foreach(explode("\n", $raw_headers) as $i => $h) {
39 39
 			$h = explode(':', $h, 2);
40
-			if (isset($h[1])){
41
-				if(!isset($headers[$h[0]])){
40
+			if(isset($h[1])) {
41
+				if(!isset($headers[$h[0]])) {
42 42
 					$headers[$h[0]] = trim($h[1]);
43
-				}else if(is_array($headers[$h[0]])){
44
-					$tmp = array_merge($headers[$h[0]],array(trim($h[1])));
43
+				} else if(is_array($headers[$h[0]])) {
44
+					$tmp = array_merge($headers[$h[0]], array(trim($h[1])));
45 45
 					$headers[$h[0]] = $tmp;
46
-				}else{
47
-					$tmp = array_merge(array($headers[$h[0]]),array(trim($h[1])));
46
+				} else {
47
+					$tmp = array_merge(array($headers[$h[0]]), array(trim($h[1])));
48 48
 					$headers[$h[0]] = $tmp;
49 49
 				}
50 50
 			}
Please login to merge, or discard this patch.
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -32,18 +32,19 @@
 block discarded – undo
32 32
 	return $time_string;
33 33
 }
34 34
 
35
-if (!function_exists('http_parse_headers')) { #http://www.php.net/manual/en/function.http-parse-headers.php#112917
35
+if (!function_exists('http_parse_headers')) {
36
+#http://www.php.net/manual/en/function.http-parse-headers.php#112917
36 37
 	function http_parse_headers (string $raw_headers) : array {
37 38
 		$headers = array(); // $headers = [];
38 39
 		foreach (explode("\n", $raw_headers) as $i => $h) {
39 40
 			$h = explode(':', $h, 2);
40
-			if (isset($h[1])){
41
-				if(!isset($headers[$h[0]])){
41
+			if (isset($h[1])) {
42
+				if(!isset($headers[$h[0]])) {
42 43
 					$headers[$h[0]] = trim($h[1]);
43
-				}else if(is_array($headers[$h[0]])){
44
+				} else if(is_array($headers[$h[0]])) {
44 45
 					$tmp = array_merge($headers[$h[0]],array(trim($h[1])));
45 46
 					$headers[$h[0]] = $tmp;
46
-				}else{
47
+				} else {
47 48
 					$tmp = array_merge(array($headers[$h[0]]),array(trim($h[1])));
48 49
 					$headers[$h[0]] = $tmp;
49 50
 				}
Please login to merge, or discard this patch.
application/controllers/Ajax/Userscript.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,9 +53,9 @@
 block discarded – undo
53 53
 				];
54 54
 
55 55
 				$this->output
56
-				     ->set_status_header('200')
57
-				     ->set_content_type('application/json', 'utf-8')
58
-				     ->set_output(json_encode($json));
56
+					 ->set_status_header('200')
57
+					 ->set_content_type('application/json', 'utf-8')
58
+					 ->set_output(json_encode($json));
59 59
 			} else {
60 60
 				//TODO: We should probably try and have more verbose errors here. Return via JSON or something.
61 61
 				$this->output->set_status_header('400', 'Unable to update?');
Please login to merge, or discard this patch.
_scripts/generate_spritesheet.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare(strict_types=1);
1
+<?php declare(strict_types = 1);
2 2
 
3 3
 if(!extension_loaded('gd')) die('GD ext is required to run this!');
4 4
 
@@ -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.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@
 block discarded – undo
1 1
 <?php declare(strict_types=1);
2 2
 
3
-if(!extension_loaded('gd')) die('GD ext is required to run this!');
3
+if(!extension_loaded('gd')) {
4
+	die('GD ext is required to run this!');
5
+}
4 6
 
5 7
 chdir(dirname(__FILE__).'/../'); //Just to make things easier, change dir to project root.
6 8
 const ASSET_FOLDER = 'public/assets';
Please login to merge, or discard this patch.
application/core/MY_Config.php 1 patch
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php defined('BASEPATH') OR exit('No direct script access allowed');
1
+<?php defined('BASEPATH') or exit('No direct script access allowed');
2 2
 
3 3
 class MY_Config extends CI_Config {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
application/views/User/Dashboard.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -136,7 +136,7 @@
 block discarded – undo
136 136
 						|
137 137
 						<a href="#" class="set-mal-id" data-mal-id="<?=$row['mal_id']?>" data-mal-type="<?=$row['mal_type']?>">Set MAL ID</a> <?php if(!is_null($row['mal_id']) && $row['mal_type'] == 'chapter') { ?><span>(<small><?=($row['mal_id'] !== '0' ? $row['mal_id'] : 'none')?></small>)</span><?php } ?>
138 138
 						|
139
-						Tags (<a href="#" class="edit-tags small">Edit</a>): <span class="text-lowercase tag-list"><?=($row['has_tags'] ? implode("", array_map(function ($str) { return "<i class='tag'>{$str}</i>"; }, explode(",", $row['tag_list']))) : "none")?></span>
139
+						Tags (<a href="#" class="edit-tags small">Edit</a>): <span class="text-lowercase tag-list"><?=($row['has_tags'] ? implode("", array_map(function($str) { return "<i class='tag'>{$str}</i>"; }, explode(",", $row['tag_list']))) : "none")?></span>
140 140
 						<div class="input-group hidden tag-edit">
141 141
 							<input type="text" class="form-control" placeholder="tag1,tag2,tag3" maxlength="255" pattern='[a-z0-9-_,]{0,255}' value="<?=$row['tag_list']?>">
142 142
 							<span class="input-group-btn">
Please login to merge, or discard this patch.
_scripts/generate_foolslide.php 3 patches
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php declare(strict_types=1);
2 2
 
3
-if(!extension_loaded('gd')) die('GD ext is required to run this!');
3
+if(!extension_loaded('gd')) {
4
+	die('GD ext is required to run this!');
5
+}
4 6
 
5 7
 chdir(dirname(__FILE__).'/../'); //Just to make things easier, change dir to project root.
6 8
 
@@ -9,7 +11,7 @@  discard block
 block discarded – undo
9 11
 	private $className;
10 12
 
11 13
 	public function __construct() {
12
-		if(isset($_SERVER['argv']) && count($_SERVER['argv']) === 3){
14
+		if(isset($_SERVER['argv']) && count($_SERVER['argv']) === 3) {
13 15
 			$this->baseURL   = rtrim($_SERVER['argv'][1], '/');
14 16
 			$this->className = $_SERVER['argv'][2];
15 17
 
@@ -82,7 +84,9 @@  discard block
 block discarded – undo
82 84
 		$baseFile = file_get_contents('./public/userscripts/manga-tracker.user.js');
83 85
 
84 86
 		$parse = parse_url($this->baseURL);
85
-		if(strpos($baseFile, $parse['host']) !== false) die("Domain already exists in userscript?");
87
+		if(strpos($baseFile, $parse['host']) !== false) {
88
+			die("Domain already exists in userscript?");
89
+		}
86 90
 
87 91
 		preg_match('/\@updated      ([0-9\-]+)\r.*?\@version      ([0-9\.]+)/s', $baseFile, $matches);
88 92
 
@@ -179,7 +183,9 @@  discard block
 block discarded – undo
179 183
 			}
180 184
 		}
181 185
 
182
-		if(empty($titleArr)) die("API isn't returning any titles?");
186
+		if(empty($titleArr)) {
187
+			die("API isn't returning any titles?");
188
+		}
183 189
 		return $titleArr;
184 190
 	}
185 191
 }
Please login to merge, or discard this patch.
Upper-Lower-Casing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
 		//Replace class names
60 60
 		$baseFile = str_replace('class HelveticaScans', "class {$this->className}", $baseFile);
61
-		$baseFile = str_replace('coversDefaultClass HelveticaScans', "coversDefaultClass {$this->className}", $baseFile);
61
+		$baseFile = str_replace('coversDefaultClass HelveticaScans', "coversdefaultclass {$this->className}", $baseFile);
62 62
 
63 63
 		//Replace tests
64 64
 		$titleList  = $this->getTitles();
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 		$baseFile = file_get_contents('./public/userscripts/manga-tracker.user.js');
83 83
 
84 84
 		$parse = parse_url($this->baseURL);
85
-		if(strpos($baseFile, $parse['host']) !== false) die("Domain already exists in userscript?");
85
+		if(strpos($baseFile, $parse['host']) !== FALSE) die("Domain already exists in userscript?");
86 86
 
87 87
 		preg_match('/\@updated      ([0-9\-]+)\r.*?\@version      ([0-9\.]+)/s', $baseFile, $matches);
88 88
 
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 	}),
114 114
 
115 115
 	//Tracking site
116
-EOT;
116
+eot;
117 117
 		$baseFile = str_replace('	//Tracking site', $siteData, $baseFile);
118 118
 
119 119
 		file_put_contents('./public/userscripts/manga-tracker.user.js', $baseFile);
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
 ## [{$date}]
147 147
 ### Added
148 148
 - Support for {$this->className}.
149
-EOT;
149
+eot;
150 150
 			$changelogFile = str_replace('All notable changes to this project will be documented in this file.', "All notable changes to this project will be documented in this file.\r\n\r\n{$log}", $changelogFile);
151 151
 		}
152 152
 
@@ -158,8 +158,8 @@  discard block
 block discarded – undo
158 158
 
159 159
 		$ch = curl_init("{$this->baseURL}/api/reader/chapters/orderby/desc_created/format/json");
160 160
 
161
-		curl_setopt($ch, CURLOPT_NOBODY, true);
162
-		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
161
+		curl_setopt($ch, CURLOPT_NOBODY, TRUE);
162
+		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
163 163
 		curl_exec($ch);
164 164
 		$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
165 165
 		curl_close($ch);
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
 		if($content = file_get_contents($jsonURL)) {
174 174
 			$json = json_decode($content, TRUE);
175 175
 			shuffle($json['comics']);
176
-			$comics = array_slice($json['comics'], 0, 5, true);
176
+			$comics = array_slice($json['comics'], 0, 5, TRUE);
177 177
 
178 178
 			foreach($comics as $comic) {
179 179
 				$titleArr[$comic['stub']] = $comic['name'];
Please login to merge, or discard this 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);
1
+<?php declare(strict_types = 1);
2 2
 
3 3
 if(!extension_loaded('gd')) die('GD ext is required to run this!');
4 4
 
@@ -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');");
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
 
98 98
 		//Update @updated
99 99
 		$currentDate = date("Y-m-d", time());
100
-		$baseFile = str_replace("@updated      {$matches[1]}","@updated      {$currentDate}", $baseFile);
100
+		$baseFile = str_replace("@updated      {$matches[1]}", "@updated      {$currentDate}", $baseFile);
101 101
 
102 102
 		//Update @version
103 103
 		$currentVersion = explode('.', $matches[2]);
104
-		$newVersion = "{$currentVersion[0]}.{$currentVersion[1]}.". (((int) $currentVersion[2]) + 1);
105
-		$baseFile = str_replace("@version      {$matches[2]}","@version      {$newVersion}", $baseFile);
104
+		$newVersion = "{$currentVersion[0]}.{$currentVersion[1]}.".(((int) $currentVersion[2]) + 1);
105
+		$baseFile = str_replace("@version      {$matches[2]}", "@version      {$newVersion}", $baseFile);
106 106
 
107 107
 		//Add site
108 108
 		$siteData = <<<EOT
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Sites_Model.php 3 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 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
Please login to merge, or discard this patch.
Braces   +30 added lines, -10 removed lines patch added patch discarded remove patch
@@ -114,7 +114,9 @@  discard block
 block discarded – undo
114 114
 	 */
115 115
 	final public function isValidTitleURL(string $title_url) : bool {
116 116
 		$success = (bool) preg_match($this->titleFormat, $title_url);
117
-		if(!$success) log_message('error', "Invalid Title URL ({$this->site}): {$title_url}");
117
+		if(!$success) {
118
+			log_message('error', "Invalid Title URL ({$this->site}): {$title_url}");
119
+		}
118 120
 		return $success;
119 121
 	}
120 122
 
@@ -128,7 +130,9 @@  discard block
 block discarded – undo
128 130
 	 */
129 131
 	final public function isValidChapter(string $chapter) : bool {
130 132
 		$success = (bool) preg_match($this->chapterFormat, $chapter);
131
-		if(!$success) log_message('error', "Invalid Chapter ({$this->site}): {$chapter}");
133
+		if(!$success) {
134
+			log_message('error', "Invalid Chapter ({$this->site}): {$chapter}");
135
+		}
132 136
 		return $success;
133 137
 	}
134 138
 
@@ -157,14 +161,20 @@  discard block
 block discarded – undo
157 161
 			//curl_setopt($ch, CURLOPT_VERBOSE, 1);
158 162
 			curl_setopt($ch, CURLOPT_HEADER, 1);
159 163
 
160
-			if($follow_redirect)        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
164
+			if($follow_redirect) {
165
+				curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
166
+			}
161 167
 
162 168
 			if($cookies = $this->cache->get("cloudflare_{$this->site}")) {
163 169
 				$cookie_string .= "; {$cookies}";
164 170
 			}
165 171
 
166
-			if(!empty($cookie_string))  curl_setopt($ch, CURLOPT_COOKIE, $cookie_string);
167
-			if(!empty($cookiejar_path)) curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar_path);
172
+			if(!empty($cookie_string)) {
173
+				curl_setopt($ch, CURLOPT_COOKIE, $cookie_string);
174
+			}
175
+			if(!empty($cookiejar_path)) {
176
+				curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar_path);
177
+			}
168 178
 
169 179
 			//Some sites check the useragent for stuff, use a pre-defined user-agent to avoid stuff.
170 180
 			curl_setopt($ch, CURLOPT_USERAGENT, $this->userAgent);
@@ -192,7 +202,9 @@  discard block
 block discarded – undo
192 202
 			$body        = substr($response, $header_size);
193 203
 			curl_close($ch);
194 204
 
195
-			if($status_code === 503) $refresh = $this->handleCloudFlare($url, $body);
205
+			if($status_code === 503) {
206
+				$refresh = $this->handleCloudFlare($url, $body);
207
+			}
196 208
 		}
197 209
 
198 210
 		return [
@@ -405,8 +417,12 @@  discard block
 block discarded – undo
405 417
 		$status = FALSE;
406 418
 
407 419
 		//Make sure we have a volume element
408
-		if(count($oldChapterSegments) === 1) array_unshift($oldChapterSegments, 'v0');
409
-		if(count($newChapterSegments) === 1) array_unshift($newChapterSegments, 'v0');
420
+		if(count($oldChapterSegments) === 1) {
421
+			array_unshift($oldChapterSegments, 'v0');
422
+		}
423
+		if(count($newChapterSegments) === 1) {
424
+			array_unshift($newChapterSegments, 'v0');
425
+		}
410 426
 
411 427
 		$oldCount = count($oldChapterSegments);
412 428
 		$newCount = count($newChapterSegments);
@@ -419,8 +435,12 @@  discard block
 block discarded – undo
419 435
 				$newVolume = substr(array_shift($newChapterSegments), 1);
420 436
 
421 437
 				//Forcing volume to 0 as TBD might not be the latest (although it can be, but that is covered by other checks)
422
-				if(in_array($oldVolume, ['TBD', 'TBA', 'NA', 'LMT'])) $oldVolume = 0;
423
-				if(in_array($newVolume, ['TBD', 'TBA', 'NA', 'LMT'])) $newVolume = 0;
438
+				if(in_array($oldVolume, ['TBD', 'TBA', 'NA', 'LMT'])) {
439
+					$oldVolume = 0;
440
+				}
441
+				if(in_array($newVolume, ['TBD', 'TBA', 'NA', 'LMT'])) {
442
+					$newVolume = 0;
443
+				}
424 444
 
425 445
 				$oldVolume = floatval($oldVolume);
426 446
 				$newVolume = floatval($newVolume);
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 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
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 
154 154
 			$ch = curl_init();
155 155
 			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
156
-			curl_setopt($ch, CURLOPT_ENCODING , "gzip");
156
+			curl_setopt($ch, CURLOPT_ENCODING, "gzip");
157 157
 			//curl_setopt($ch, CURLOPT_VERBOSE, 1);
158 158
 			curl_setopt($ch, CURLOPT_HEADER, 1);
159 159
 
@@ -175,8 +175,8 @@  discard block
 block discarded – undo
175 175
 			curl_setopt($ch, CURLOPT_URL, $url);
176 176
 
177 177
 			if($isPost) {
178
-				curl_setopt($ch,CURLOPT_POST, count($postFields));
179
-				curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($postFields));
178
+				curl_setopt($ch, CURLOPT_POST, count($postFields));
179
+				curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postFields));
180 180
 			}
181 181
 
182 182
 			$response = curl_exec($ch);
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
 			$result = shell_exec('python '.APPPATH.'../_scripts/get_cloudflare_cookie.py '.escapeshellarg(json_encode($urlData)));
224 224
 			$cookieData = json_decode($result, TRUE);
225 225
 
226
-			$this->cache->save("cloudflare_{$this->site}", $cookieData['cookies'],  31536000 /* 1 year, or until we renew it */);
226
+			$this->cache->save("cloudflare_{$this->site}", $cookieData['cookies'], 31536000 /* 1 year, or until we renew it */);
227 227
 			log_message('debug', "Saving CloudFlare Cookies for {$this->site}");
228 228
 
229 229
 			$refresh = TRUE;
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 
275 275
 				$dom = new DOMDocument();
276 276
 				libxml_use_internal_errors(TRUE);
277
-				$dom->loadHTML('<?xml encoding="utf-8" ?>' . $data);
277
+				$dom->loadHTML('<?xml encoding="utf-8" ?>'.$data);
278 278
 				libxml_use_internal_errors(FALSE);
279 279
 
280 280
 				$xpath = new DOMXPath($dom);
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
 				$nodes_row   = $xpath->query($node_row_string);
283 283
 				if($nodes_title->length === 1 && $nodes_row->length === 1) {
284 284
 					$firstRow      = $nodes_row->item(0);
285
-					$nodes_latest  = $xpath->query($node_latest_string,  $firstRow);
285
+					$nodes_latest  = $xpath->query($node_latest_string, $firstRow);
286 286
 
287 287
 					if($node_chapter_string !== '') {
288 288
 						$nodes_chapter = $xpath->query($node_chapter_string, $firstRow);
@@ -470,7 +470,7 @@  discard block
 block discarded – undo
470 470
 		$chapter_parts = explode('/', $chapter); //returns #LANG#/#VOLUME#/#CHAPTER#/#CHAPTER_EXTRA#(/#PAGE#/)
471 471
 		return [
472 472
 			'url'    => $this->getChapterURL($title_url, $chapter),
473
-			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
473
+			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '')."c{$chapter_parts[2]}".(isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
474 474
 		];
475 475
 	}
476 476
 	public function getChapterURL(string $title_url, string $chapter) : string {
@@ -675,9 +675,9 @@  discard block
 block discarded – undo
675 675
 
676 676
 							$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.
677 677
 							if($dateString == 'T') {
678
-								$dateString = date("Y-m-d",now());
678
+								$dateString = date("Y-m-d", now());
679 679
 							}
680
-							$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString . ' 00:00'));
680
+							$titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString.' 00:00'));
681 681
 
682 682
 							$titleDataList[$title_url] = $titleData;
683 683
 						}
Please login to merge, or discard this patch.
application/libraries/Cacher.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 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
 //Because we can't autoload the cache driver with params - https://forum.codeigniter.com/thread-62217-post-319687.html#pid319687
4 4
 class Cacher {
5 5
 	protected $CI;
6 6
 
7 7
 	public function __construct() {
8
-		$this->CI =& get_instance(); //grab an instance of CI
8
+		$this->CI = & get_instance(); //grab an instance of CI
9 9
 		$this->initiate_cache();
10 10
 	}
11 11
 
Please login to merge, or discard this patch.
application/models/Tracker/Tracker_Issue_Model.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -11,9 +11,9 @@
 block discarded – undo
11 11
 
12 12
 		//This is pretty barebones issue reporting, and honestly not a great way to do it, but it works for now (until the Github is public).
13 13
 		$body = "".
14
-		        (!is_null($url) && !empty($url) ? "URL: ".htmlspecialchars(substr($url, 0, 255))."<br>\n" : "").
15
-		        "Submitted by: ".$this->input->ip_address().(!is_null($userID) ? "| {$userID}" : "")."<br>\n".
16
-		        "<br>Bug report: ".htmlspecialchars(substr($text, 0, 1000));
14
+				(!is_null($url) && !empty($url) ? "URL: ".htmlspecialchars(substr($url, 0, 255))."<br>\n" : "").
15
+				"Submitted by: ".$this->input->ip_address().(!is_null($userID) ? "| {$userID}" : "")."<br>\n".
16
+				"<br>Bug report: ".htmlspecialchars(substr($text, 0, 1000));
17 17
 
18 18
 		$success = TRUE;
19 19
 		$this->email->from('[email protected]', $this->config->item('site_title', 'ion_auth'));
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 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_Issue_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 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_Issue_Model extends Tracker_Base_Model {
4 4
 	public function __construct() {
Please login to merge, or discard this patch.