@@ -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() { |
@@ -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 | } |
@@ -1,4 +1,4 @@ discard block |
||
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 |
||
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 |
||
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". |
@@ -16,12 +16,12 @@ discard block |
||
16 | 16 | $this->header_data['page'] = "forgot_password"; |
17 | 17 | |
18 | 18 | //TODO (RESEARCH): Should we allow username here too? |
19 | - $this->form_validation->set_rules('email', 'Email', 'required|valid_email', array( |
|
19 | + $this->form_validation->set_rules('email', 'Email', 'required|valid_email', array( |
|
20 | 20 | 'required' => 'Please enter your email.', |
21 | 21 | 'valid_email' => 'The email your entered is invalid.' |
22 | 22 | )); |
23 | 23 | |
24 | - if ($this->form_validation->run() === TRUE) { |
|
24 | + if($this->form_validation->run() === TRUE) { |
|
25 | 25 | //form is valid |
26 | 26 | |
27 | 27 | $identity = $this->ion_auth->where('email', $this->input->post('email'))->users()->row(); |
@@ -71,21 +71,21 @@ discard block |
||
71 | 71 | $this->header_data['page'] = "reset-password"; |
72 | 72 | |
73 | 73 | $user = $this->ion_auth->forgotten_password_check($code); |
74 | - if ($user) { |
|
74 | + if($user) { |
|
75 | 75 | //code is valid, show reset form or process reset |
76 | 76 | $min_password_length = $this->config->item('min_password_length', 'ion_auth'); |
77 | 77 | $max_password_length = $this->config->item('max_password_length', 'ion_auth'); |
78 | - $this->form_validation->set_rules('new_password', "Password", 'required|min_length['.$min_password_length.']|max_length['.$max_password_length.']'); |
|
78 | + $this->form_validation->set_rules('new_password', "Password", 'required|min_length['.$min_password_length.']|max_length['.$max_password_length.']'); |
|
79 | 79 | $this->form_validation->set_rules('new_password_confirm', "Password Confirm", 'required|matches[new_password]'); |
80 | 80 | |
81 | - if ($this->form_validation->run() === TRUE) { |
|
81 | + if($this->form_validation->run() === TRUE) { |
|
82 | 82 | //form is valid, process the password reset request |
83 | 83 | //TODO (Research): The original ion_auth auth.php sent the userid to the form, then matched it on return, is there any point to this? |
84 | 84 | |
85 | 85 | $identity = $user->{'email'}; |
86 | 86 | $change = $this->ion_auth->reset_password($identity, $this->input->post('new_password')); |
87 | 87 | |
88 | - if ($change) { |
|
88 | + if($change) { |
|
89 | 89 | //password changed successfully, redirect to login |
90 | 90 | $this->session->set_flashdata('notices', $this->ion_auth->messages()); |
91 | 91 | redirect("user/login", 'refresh'); |