@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | // Maintenance Mode |
40 | 40 | define('MAINTENANCE', FALSE); |
41 | 41 | if(MAINTENANCE && PHP_SAPI !== 'cli') { |
42 | - require_once __DIR__ . DIRECTORY_SEPARATOR . '../application/views/common/maintenance.php'; ## call view |
|
42 | + require_once __DIR__.DIRECTORY_SEPARATOR.'../application/views/common/maintenance.php'; ## call view |
|
43 | 43 | exit(); |
44 | 44 | } |
45 | 45 | |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | * Different environments will require different levels of error reporting. |
82 | 82 | * By default development will show errors but testing and live will hide them. |
83 | 83 | */ |
84 | -switch (ENVIRONMENT) |
|
84 | +switch(ENVIRONMENT) |
|
85 | 85 | { |
86 | 86 | case 'development': |
87 | 87 | error_reporting(-1); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | case 'testing': |
95 | 95 | case 'production': |
96 | 96 | ini_set('display_errors', 0); |
97 | - if (version_compare(PHP_VERSION, '5.3', '>=')) |
|
97 | + if(version_compare(PHP_VERSION, '5.3', '>=')) |
|
98 | 98 | { |
99 | 99 | error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT & ~E_USER_NOTICE & ~E_USER_DEPRECATED); |
100 | 100 | } |
@@ -212,12 +212,12 @@ discard block |
||
212 | 212 | */ |
213 | 213 | |
214 | 214 | // Set the current directory correctly for CLI requests |
215 | -if (defined('STDIN')) |
|
215 | +if(defined('STDIN')) |
|
216 | 216 | { |
217 | 217 | chdir(dirname(__FILE__)); |
218 | 218 | } |
219 | 219 | |
220 | -if (($_temp = realpath($system_path)) !== FALSE) |
|
220 | +if(($_temp = realpath($system_path)) !== FALSE) |
|
221 | 221 | { |
222 | 222 | $system_path = $_temp.DIRECTORY_SEPARATOR; |
223 | 223 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | } |
233 | 233 | |
234 | 234 | // Is the system path correct? |
235 | -if ( ! is_dir($system_path)) |
|
235 | +if(!is_dir($system_path)) |
|
236 | 236 | { |
237 | 237 | header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); |
238 | 238 | echo 'Your system folder path does not appear to be set correctly. Please open the following file and correct this: '.pathinfo(__FILE__, PATHINFO_BASENAME); |
@@ -257,9 +257,9 @@ discard block |
||
257 | 257 | define('SYSDIR', basename(BASEPATH)); |
258 | 258 | |
259 | 259 | // The path to the "application" directory |
260 | -if (is_dir($application_folder)) |
|
260 | +if(is_dir($application_folder)) |
|
261 | 261 | { |
262 | - if (($_temp = realpath($application_folder)) !== FALSE) |
|
262 | + if(($_temp = realpath($application_folder)) !== FALSE) |
|
263 | 263 | { |
264 | 264 | $application_folder = $_temp; |
265 | 265 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | ); |
273 | 273 | } |
274 | 274 | } |
275 | -elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) |
|
275 | +elseif(is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) |
|
276 | 276 | { |
277 | 277 | $application_folder = BASEPATH.strtr( |
278 | 278 | trim($application_folder, '/\\'), |
@@ -290,13 +290,13 @@ discard block |
||
290 | 290 | define('APPPATH', $application_folder.DIRECTORY_SEPARATOR); |
291 | 291 | |
292 | 292 | // The path to the "views" directory |
293 | -if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) |
|
293 | +if(!isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) |
|
294 | 294 | { |
295 | 295 | $view_folder = APPPATH.'views'; |
296 | 296 | } |
297 | -elseif (is_dir($view_folder)) |
|
297 | +elseif(is_dir($view_folder)) |
|
298 | 298 | { |
299 | - if (($_temp = realpath($view_folder)) !== FALSE) |
|
299 | + if(($_temp = realpath($view_folder)) !== FALSE) |
|
300 | 300 | { |
301 | 301 | $view_folder = $_temp; |
302 | 302 | } |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | ); |
310 | 310 | } |
311 | 311 | } |
312 | -elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) |
|
312 | +elseif(is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) |
|
313 | 313 | { |
314 | 314 | $view_folder = APPPATH.strtr( |
315 | 315 | trim($view_folder, '/\\'), |
@@ -10,7 +10,7 @@ |
||
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')?>. |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | if($query->num_rows() > 0) { |
80 | 80 | $hardRateLimit = 500; //This is to avoid any possible IP bans by cache breaking again. |
81 | 81 | $siteRateLimits = []; |
82 | - foreach ($query->result() as $row) { |
|
83 | - if(!array_key_exists($row->site_class,$siteRateLimits)) { |
|
82 | + foreach($query->result() as $row) { |
|
83 | + if(!array_key_exists($row->site_class, $siteRateLimits)) { |
|
84 | 84 | $siteRateLimits[$row->site_class] = 0; |
85 | 85 | } |
86 | 86 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | $query = $query->get(); |
149 | 149 | |
150 | 150 | if($query->num_rows() > 0) { |
151 | - foreach ($query->result() as $row) { |
|
151 | + foreach($query->result() as $row) { |
|
152 | 152 | $this->handleUpdate($row); |
153 | 153 | } |
154 | 154 | } |
@@ -226,10 +226,10 @@ discard block |
||
226 | 226 | ->get(); |
227 | 227 | |
228 | 228 | $sites = $query->result_array(); |
229 | - foreach ($sites as $site) { |
|
229 | + foreach($sites as $site) { |
|
230 | 230 | $siteClass = $this->sites->{$site['site_class']}; |
231 | 231 | if($titleDataList = $siteClass->doCustomUpdate()) { |
232 | - foreach ($titleDataList as $titleURL => $titleData) { |
|
232 | + foreach($titleDataList as $titleURL => $titleData) { |
|
233 | 233 | $titleURL = (string) $titleURL; //Number only keys get converted to int for some reason, so we need to fix that. |
234 | 234 | print "> {$titleData['title']} <{$site['site_class']}>"; //Print this prior to doing anything so we can more easily find out if something went wrong |
235 | 235 | if(is_array($titleData) && !is_null($titleData['latest_chapter'])) { |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | $query = $this->db->select('tracker_titles.id, tracker_titles.title_url, tracker_sites.site_class') |
273 | 273 | ->from('tracker_titles') |
274 | 274 | ->join('tracker_sites', 'tracker_sites.id = tracker_titles.site_id', 'left') |
275 | - ->where('tracker_titles.followed','N') |
|
275 | + ->where('tracker_titles.followed', 'N') |
|
276 | 276 | ->where('tracker_titles !=', '255') |
277 | 277 | ->where('tracker_sites.status', 'enabled') |
278 | 278 | ->where('tracker_sites.use_custom', 'Y') |
@@ -26,10 +26,10 @@ discard block |
||
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 |
||
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 |
||
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', '0.0.0'); //This is automatically updated on deployment. |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | chmod_files(); |
11 | 11 | |
12 | 12 | //Make sure .gitkeep file is recreated |
13 | - touch(getcwd() . '/application/tests/_ci_phpunit_test/.gitkeep'); |
|
13 | + touch(getcwd().'/application/tests/_ci_phpunit_test/.gitkeep'); |
|
14 | 14 | } |
15 | 15 | |
16 | 16 | /**********************************************************************************************************************/ |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | } |
22 | 22 | |
23 | 23 | function chmod_files() { |
24 | - $directory = new RecursiveDirectoryIterator(getcwd() . '/application/config'); |
|
24 | + $directory = new RecursiveDirectoryIterator(getcwd().'/application/config'); |
|
25 | 25 | $flattened = new RecursiveIteratorIterator($directory); |
26 | 26 | |
27 | 27 | $files = new RegexIterator($flattened, '/^(.*\/)?(database|database_password|config|email|recaptcha|sites)\.php/'); |
@@ -7,7 +7,7 @@ |
||
7 | 7 | $userscriptProd = file_get_contents('./public/userscripts/manga-tracker.user.js'); |
8 | 8 | |
9 | 9 | // Replace where needed. |
10 | -$userscriptProd = str_replace('https://trackr.moe/userscripts','http://manga-tracker.localhost:20180/userscripts', $userscriptProd); |
|
10 | +$userscriptProd = str_replace('https://trackr.moe/userscripts', 'http://manga-tracker.localhost:20180/userscripts', $userscriptProd); |
|
11 | 11 | |
12 | 12 | // Push to dev file. |
13 | 13 | file_put_contents('./public/userscripts/manga-tracker.dev.user.js', $userscriptProd); |
@@ -120,15 +120,15 @@ discard block |
||
120 | 120 | )'); |
121 | 121 | }); |
122 | 122 | |
123 | -task('deploy:copy_files', function () { |
|
123 | +task('deploy:copy_files', function() { |
|
124 | 124 | $sharedPath = '{{deploy_path}}/shared'; |
125 | - foreach (get('copy_files') as $file) { |
|
125 | + foreach(get('copy_files') as $file) { |
|
126 | 126 | $dirname = dirname(parse($file)); |
127 | 127 | // Create dir of shared file |
128 | - runS("mkdir -p $sharedPath/" . $dirname); |
|
128 | + runS("mkdir -p $sharedPath/".$dirname); |
|
129 | 129 | // Check if shared file does not exist in shared. |
130 | 130 | // and file exist in release |
131 | - if (!test("[ -f $sharedPath/$file ]") && test("[ -f {{release_path}}/$file ]")) { |
|
131 | + if(!test("[ -f $sharedPath/$file ]") && test("[ -f {{release_path}}/$file ]")) { |
|
132 | 132 | // Copy file in shared dir if not present |
133 | 133 | runS("cp -rv {{release_path}}/$file $sharedPath/$file"); |
134 | 134 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | } |
144 | 144 | }); |
145 | 145 | |
146 | -task('deploy:migrate_db', function () { |
|
146 | +task('deploy:migrate_db', function() { |
|
147 | 147 | // Migration is disabled by default on production, so we need to toggle it temporally. |
148 | 148 | runS('( \ |
149 | 149 | cd {{release_path}} && \ |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | )'); |
154 | 154 | }); |
155 | 155 | |
156 | -task('deploy:maintenance_enable', function () { |
|
156 | +task('deploy:maintenance_enable', function() { |
|
157 | 157 | //define('MAINTENANCE', FALSE); |
158 | 158 | runS('( \ |
159 | 159 | cd {{previous_release}} && \ |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | sed -i -r "s/(\'MAINTENANCE\',) FALSE/\1 TRUE/" public/index.php \ |
165 | 165 | )'); |
166 | 166 | }); |
167 | -task('deploy:maintenance_disable', function () { |
|
167 | +task('deploy:maintenance_disable', function() { |
|
168 | 168 | //define('MAINTENANCE', FALSE); |
169 | 169 | runS('( \ |
170 | 170 | cd {{release_path}} && \ |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | //We don't want double trailing slashes, so fix this when possible. |
121 | 121 | $pageSeparator = ''; |
122 | 122 | } |
123 | - $pageURL = $chapterData['url'] . $pageSeparator . $page; |
|
123 | + $pageURL = $chapterData['url'].$pageSeparator.$page; |
|
124 | 124 | } |
125 | 125 | return $pageURL; |
126 | 126 | } |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | |
215 | 215 | $ch = curl_init(); |
216 | 216 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
217 | - curl_setopt($ch, CURLOPT_ENCODING , 'gzip'); |
|
217 | + curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); |
|
218 | 218 | //curl_setopt($ch, CURLOPT_VERBOSE, 1); |
219 | 219 | curl_setopt($ch, CURLOPT_HEADER, 1); |
220 | 220 | |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | curl_setopt($ch, CURLOPT_URL, $url); |
242 | 242 | |
243 | 243 | if($isPost) { |
244 | - curl_setopt($ch,CURLOPT_POST, count($postFields)); |
|
245 | - curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($postFields)); |
|
244 | + curl_setopt($ch, CURLOPT_POST, count($postFields)); |
|
245 | + curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postFields)); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | $response = curl_exec($ch); |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $result = shell_exec('python3 '.APPPATH.'../_scripts/get_cloudflare_cookie.py '.escapeshellarg(json_encode($urlData))); |
290 | 290 | $cookieData = json_decode($result, TRUE); |
291 | 291 | |
292 | - $this->cache->save("cloudflare_{$this->site}", $cookieData['cookies'], 31536000 /* 1 year, or until we renew it */); |
|
292 | + $this->cache->save("cloudflare_{$this->site}", $cookieData['cookies'], 31536000 /* 1 year, or until we renew it */); |
|
293 | 293 | log_message('debug', "Saving CloudFlare Cookies for {$this->site}"); |
294 | 294 | |
295 | 295 | $refresh = TRUE; |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | |
353 | 353 | $dom = new DOMDocument(); |
354 | 354 | libxml_use_internal_errors(TRUE); |
355 | - $dom->loadHTML('<?xml encoding="utf-8" ?>' . $data); |
|
355 | + $dom->loadHTML('<?xml encoding="utf-8" ?>'.$data); |
|
356 | 356 | libxml_use_internal_errors(FALSE); |
357 | 357 | |
358 | 358 | $xpath = new DOMXPath($dom); |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | if($nodes_title->length === 1) { |
362 | 362 | if($nodes_row->length === 1) { |
363 | 363 | $firstRow = $nodes_row->item(0); |
364 | - $nodes_latest = $xpath->query($node_latest_string, $firstRow); |
|
364 | + $nodes_latest = $xpath->query($node_latest_string, $firstRow); |
|
365 | 365 | |
366 | 366 | if($node_chapter_string !== '') { |
367 | 367 | $nodes_chapter = $xpath->query($node_chapter_string, $firstRow); |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | final private function _setSiteRateLimit(?int $rateLimit = NULL) : bool { |
578 | 578 | //We would just use increment(), but we can't set ttl with it... |
579 | 579 | $currentRateLimit = $rateLimit ?: $this->_getSiteRateLimit(); |
580 | - return $this->cache->save("{$this->site}_ratelimit", $currentRateLimit + 1,3600); |
|
580 | + return $this->cache->save("{$this->site}_ratelimit", $currentRateLimit + 1, 3600); |
|
581 | 581 | } |
582 | 582 | } |
583 | 583 | |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | $chapter_parts = explode('/', $chapter); //returns #LANG#/#VOLUME#/#CHAPTER#/#CHAPTER_EXTRA#(/#PAGE#/) |
596 | 596 | return [ |
597 | 597 | 'url' => $this->getChapterURL($title_url, $chapter), |
598 | - 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
598 | + 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '')."c{$chapter_parts[2]}".(isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
599 | 599 | ]; |
600 | 600 | } |
601 | 601 | public function getChapterURL(string $title_url, string $chapter) : string { |
@@ -785,9 +785,9 @@ discard block |
||
785 | 785 | |
786 | 786 | $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. |
787 | 787 | if($dateString == 'T') { |
788 | - $dateString = date("Y-m-d",now()); |
|
788 | + $dateString = date("Y-m-d", now()); |
|
789 | 789 | } |
790 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString . ' 00:00')); |
|
790 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString.' 00:00')); |
|
791 | 791 | |
792 | 792 | $titleDataList[$title_url] = $titleData; |
793 | 793 | } |
@@ -811,7 +811,7 @@ discard block |
||
811 | 811 | public $chapterFormat = '/^[0-9\.]+$/'; |
812 | 812 | public $pageSeparator = '/'; |
813 | 813 | |
814 | - public $customType = 2;# |
|
814 | + public $customType = 2; # |
|
815 | 815 | |
816 | 816 | public $version = 1; # New versions of GlossyBright have a diff style. |
817 | 817 | |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | $titleData['title'] = preg_replace('/^Meraki Scans - (.*?)$/', '$1', trim($data['nodes_title']->textContent)); |
870 | 870 | //For whatever reason, DOMDocument breaks the <link> element we need to grab the chapter, so we have to grab it elsewhere. |
871 | 871 | $chapter = preg_replace('/^.*?(https:\/\/.*)$/', '$1', trim($data['nodes_chapter']->textContent)); |
872 | - $titleData['latest_chapter'] = explode('/', $chapter)[sizeof(explode('/', $chapter))-2]; |
|
872 | + $titleData['latest_chapter'] = explode('/', $chapter)[sizeof(explode('/', $chapter)) - 2]; |
|
873 | 873 | |
874 | 874 | $titleData['last_updated'] = date('Y-m-d H:i:s', strtotime((string) $data['nodes_latest']->textContent)); |
875 | 875 | } |
@@ -979,11 +979,11 @@ discard block |
||
979 | 979 | "" |
980 | 980 | ); |
981 | 981 | if($data) { |
982 | - $titleData['title'] = trim(preg_replace('/ Added on .*$/','', $data['nodes_title']->textContent)); |
|
982 | + $titleData['title'] = trim(preg_replace('/ Added on .*$/', '', $data['nodes_title']->textContent)); |
|
983 | 983 | $titleData['latest_chapter'] = preg_replace('/^.*\/([0-9\.]+)$/', '$1', (string) $data['nodes_chapter']->getAttribute('href')); |
984 | 984 | |
985 | - $dateString = preg_replace('/^Added (?:on )?/', '',$data['nodes_latest']->textContent); |
|
986 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString)); |
|
985 | + $dateString = preg_replace('/^Added (?:on )?/', '', $data['nodes_latest']->textContent); |
|
986 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime($dateString)); |
|
987 | 987 | } |
988 | 988 | return (!empty($titleData) ? $titleData : NULL); |
989 | 989 | } |
@@ -1061,9 +1061,9 @@ discard block |
||
1061 | 1061 | public function getChapterData(string $title_url, string $chapter) : array { |
1062 | 1062 | if(strpos($chapter, '/')) { |
1063 | 1063 | $chapterArr = explode('/', $chapter); |
1064 | - $chapterN = "v{$chapterArr[0]}/c".str_replace('chapter_','',$chapterArr[1]); |
|
1065 | - } else if (ctype_digit($chapter)) { |
|
1066 | - $chapterN = 'c'.str_replace('chapter_','', $chapter); |
|
1064 | + $chapterN = "v{$chapterArr[0]}/c".str_replace('chapter_', '', $chapterArr[1]); |
|
1065 | + } else if(ctype_digit($chapter)) { |
|
1066 | + $chapterN = 'c'.str_replace('chapter_', '', $chapter); |
|
1067 | 1067 | } |
1068 | 1068 | return [ |
1069 | 1069 | 'url' => $this->getChapterURL($title_url, $chapter), |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | return; |
16 | 16 | |
17 | 17 | $this->form_validation->set_rules('issue_description', 'Description', 'required|max_length[1000]'); |
18 | - $this->form_validation->set_rules('issue_url', 'URL', 'valid_url'); |
|
18 | + $this->form_validation->set_rules('issue_url', 'URL', 'valid_url'); |
|
19 | 19 | |
20 | 20 | |
21 | 21 | $this->body_data['issue_submitted'] = FALSE; |
@@ -24,9 +24,9 @@ discard block |
||
24 | 24 | |
25 | 25 | if(!empty($this->input->post('website'))) { |
26 | 26 | $this->body_data['issue_submitted'] = FALSE; |
27 | - log_message('error', 'Bot attempting to spam report issue form: "' . $this->input->post('issue_description') . '"'); |
|
27 | + log_message('error', 'Bot attempting to spam report issue form: "'.$this->input->post('issue_description').'"'); |
|
28 | 28 | } else { |
29 | - $this->body_data['issue_submitted'] = $this->Tracker->issue->report('USERID:' . $this->User->id . ' ||| ' . $this->input->post('issue_description'), NULL, $this->input->post('issue_url')); |
|
29 | + $this->body_data['issue_submitted'] = $this->Tracker->issue->report('USERID:'.$this->User->id.' ||| '.$this->input->post('issue_description'), NULL, $this->input->post('issue_url')); |
|
30 | 30 | } |
31 | 31 | } |
32 | 32 |