@@ -1,4 +1,4 @@ |
||
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_Tag_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -1,4 +1,4 @@ |
||
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_Category_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -1,4 +1,4 @@ |
||
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_Title_Model extends Tracker_Base_Model { |
4 | 4 | public function __construct() { |
@@ -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,18 +73,18 @@ 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 |
@@ -16,16 +16,16 @@ discard block |
||
16 | 16 | $usedCategories = $this->Tracker->category->getUsed($this->User->id); |
17 | 17 | |
18 | 18 | //NOTE: The checkbox validation is handled in run() |
19 | - $this->form_validation->set_rules('category_custom_1_text', 'Custom Category 1 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]'); |
|
20 | - $this->form_validation->set_rules('category_custom_2_text', 'Custom Category 2 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]'); |
|
21 | - $this->form_validation->set_rules('category_custom_3_text', 'Custom Category 3 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]'); |
|
19 | + $this->form_validation->set_rules('category_custom_1_text', 'Custom Category 1 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]'); |
|
20 | + $this->form_validation->set_rules('category_custom_2_text', 'Custom Category 2 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]'); |
|
21 | + $this->form_validation->set_rules('category_custom_3_text', 'Custom Category 3 Text', 'trim|regex_match[/^[a-zA-Z0-9-_\\s]{0,16}$/]'); |
|
22 | 22 | $this->form_validation->set_rules('default_series_category', 'Default Series Category', 'required|is_valid_option_value[default_series_category]'); |
23 | - $this->form_validation->set_rules('list_sort_type', 'List Sort Type', 'required|is_valid_option_value[list_sort_type]'); |
|
24 | - $this->form_validation->set_rules('list_sort_order', 'List Sort Order', 'required|is_valid_option_value[list_sort_order]'); |
|
25 | - $this->form_validation->set_rules('theme', 'Theme', 'required|is_valid_option_value[theme]'); |
|
26 | - $this->form_validation->set_rules('mal_sync', 'MAL Sync', 'required|is_valid_option_value[mal_sync]'); |
|
23 | + $this->form_validation->set_rules('list_sort_type', 'List Sort Type', 'required|is_valid_option_value[list_sort_type]'); |
|
24 | + $this->form_validation->set_rules('list_sort_order', 'List Sort Order', 'required|is_valid_option_value[list_sort_order]'); |
|
25 | + $this->form_validation->set_rules('theme', 'Theme', 'required|is_valid_option_value[theme]'); |
|
26 | + $this->form_validation->set_rules('mal_sync', 'MAL Sync', 'required|is_valid_option_value[mal_sync]'); |
|
27 | 27 | |
28 | - if ($isValid = $this->form_validation->run() === TRUE) { |
|
28 | + if($isValid = $this->form_validation->run() === TRUE) { |
|
29 | 29 | foreach($customCategories as $categoryK => $category) { |
30 | 30 | if(!in_array($categoryK, $usedCategories)) { |
31 | 31 | $this->User_Options->set($category, $this->input->post($category) ? 'enabled' : 'disabled'); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | $this->User_Options->set('enable_live_countdown_timer', $this->input->post('enable_live_countdown_timer')); |
40 | 40 | |
41 | - $this->User_Options->set('list_sort_type', $this->input->post('list_sort_type')); |
|
41 | + $this->User_Options->set('list_sort_type', $this->input->post('list_sort_type')); |
|
42 | 42 | $this->User_Options->set('list_sort_order', $this->input->post('list_sort_order')); |
43 | 43 | |
44 | 44 | $this->User_Options->set('theme', $this->input->post('theme')); |
@@ -1,4 +1,4 @@ |
||
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 AdminPanel extends Admin_Controller { |
4 | 4 | public function __construct() { |
@@ -1,4 +1,4 @@ |
||
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 UpdateStatus extends MY_Controller { |
4 | 4 | public function __construct() { |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | * URL: /ajax/update_inline |
27 | 27 | */ |
28 | 28 | public function update() : void { |
29 | - $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
30 | - $this->form_validation->set_rules('chapter', 'Chapter', 'required'); |
|
29 | + $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
30 | + $this->form_validation->set_rules('chapter', 'Chapter', 'required'); |
|
31 | 31 | |
32 | 32 | if($this->form_validation->run() === TRUE) { |
33 | 33 | $success = $this->Tracker->list->updateByID($this->userID, $this->input->post('id'), $this->input->post('chapter')); |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * URL: /tag_update |
123 | 123 | */ |
124 | 124 | public function tag_update() : void { |
125 | - $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
125 | + $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
126 | 126 | $this->form_validation->set_rules('tag_string', 'Tag String', 'max_length[255]|is_valid_tag_string|not_equals[none]'); |
127 | 127 | |
128 | 128 | if($this->form_validation->run() === TRUE) { |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * URL: /set_category |
170 | 170 | */ |
171 | 171 | public function set_category() : void { |
172 | - $this->form_validation->set_rules('id[]', 'List of IDs', 'required|ctype_digit'); |
|
172 | + $this->form_validation->set_rules('id[]', 'List of IDs', 'required|ctype_digit'); |
|
173 | 173 | $this->form_validation->set_rules('category', 'Category Name', 'required|is_valid_category'); |
174 | 174 | |
175 | 175 | if($this->form_validation->run() === TRUE) { |
@@ -215,8 +215,8 @@ discard block |
||
215 | 215 | * URL: /ajax/ignore_inline |
216 | 216 | */ |
217 | 217 | public function ignore() : void { |
218 | - $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
219 | - $this->form_validation->set_rules('chapter', 'Chapter', 'required'); |
|
218 | + $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
219 | + $this->form_validation->set_rules('chapter', 'Chapter', 'required'); |
|
220 | 220 | |
221 | 221 | if($this->form_validation->run() === TRUE) { |
222 | 222 | $success = $this->Tracker->list->ignoreByID($this->userID, $this->input->post('id'), $this->input->post('chapter')); |
@@ -238,8 +238,8 @@ discard block |
||
238 | 238 | * URL: /set_mal_id |
239 | 239 | */ |
240 | 240 | public function set_mal_id() : void { |
241 | - $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
242 | - $this->form_validation->set_rules('mal_id', 'MAL ID', 'regex_match[/^[0-9]*$/]'); |
|
241 | + $this->form_validation->set_rules('id', 'Chapter ID', 'required|ctype_digit'); |
|
242 | + $this->form_validation->set_rules('mal_id', 'MAL ID', 'regex_match[/^[0-9]*$/]'); |
|
243 | 243 | |
244 | 244 | if($this->form_validation->run() === TRUE) { |
245 | 245 | $malID = (is_numeric($this->input->post('mal_id')) ? $this->input->post('mal_id') : NULL); |
@@ -1,4 +1,4 @@ discard block |
||
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 |
||
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 |
||
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 | } |