@@ -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', '1.10.31'); //This is automatically set by a PHPStorm File Watcher |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -defined('BASEPATH') OR exit('No direct script access allowed'); |
|
2 | +defined('BASEPATH') or exit('No direct script access allowed'); |
|
3 | 3 | |
4 | 4 | /* |
5 | 5 | |-------------------------------------------------------------------------- |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | | of this setting |
12 | 12 | | |
13 | 13 | */ |
14 | -defined('SHOW_DEBUG_BACKTRACE') OR define('SHOW_DEBUG_BACKTRACE', TRUE); |
|
14 | +defined('SHOW_DEBUG_BACKTRACE') or define('SHOW_DEBUG_BACKTRACE', TRUE); |
|
15 | 15 | |
16 | 16 | /* |
17 | 17 | |-------------------------------------------------------------------------- |
@@ -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); |
|
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); |
|
29 | +defined('FILE_READ_MODE') or define('FILE_READ_MODE', 0644); |
|
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); |
|
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 |
|
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'); |
|
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 | +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'); |
|
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 |
|
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 |
|
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 | +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 |
|
86 | 86 | |
87 | 87 | /***** TIMEAGO CONSTANTS *****/ |
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 |
|
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 |
|
91 | 91 | |
92 | -defined('USERSCRIPT_VERSION') OR define('USERSCRIPT_VERSION', '1.10.31'); //This is automatically set by a PHPStorm File Watcher |
|
92 | +defined('USERSCRIPT_VERSION') or define('USERSCRIPT_VERSION', '1.10.31'); //This is automatically set by a PHPStorm File Watcher |
@@ -12,7 +12,7 @@ discard block |
||
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 |
||
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 |
@@ -188,7 +188,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |