@@ -1,14 +1,12 @@ discard block |
||
1 | 1 | <?php defined('BASEPATH') OR exit('No direct script access allowed'); |
2 | 2 | |
3 | 3 | class Migration_Setup_Sessions extends CI_Migration { |
4 | - public function __construct() |
|
5 | - { |
|
4 | + public function __construct() { |
|
6 | 5 | parent::__construct(); |
7 | 6 | $this->load->dbforge(); |
8 | 7 | } |
9 | 8 | |
10 | - public function up() |
|
11 | - { |
|
9 | + public function up() { |
|
12 | 10 | // Table structure for table 'ci_sessions' |
13 | 11 | $this->dbforge->add_field(array( |
14 | 12 | 'id' => array( |
@@ -39,8 +37,7 @@ discard block |
||
39 | 37 | $this->dbforge->create_table('ci_sessions'); |
40 | 38 | } |
41 | 39 | |
42 | - public function down() |
|
43 | - { |
|
40 | + public function down() { |
|
44 | 41 | $this->dbforge->drop_table('ci_sessions', TRUE); |
45 | 42 | } |
46 | 43 | } |
@@ -1,4 +1,4 @@ |
||
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 | /** |
4 | 4 | * Rate Limiter Configuration |
@@ -6,7 +6,7 @@ |
||
6 | 6 | protected $footer_data = array(); |
7 | 7 | public $global_data = array(); |
8 | 8 | |
9 | - public function __construct(){ |
|
9 | + public function __construct() { |
|
10 | 10 | parent::__construct(); |
11 | 11 | |
12 | 12 | //FIXME: This is pretty much a phpUnit hack. Without it phpUnit fails here. We need a proper way to fake user/admin testing. |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | protected $footer_data = array(); |
7 | 7 | public $global_data = array(); |
8 | 8 | |
9 | - public function __construct(){ |
|
9 | + public function __construct() { |
|
10 | 10 | parent::__construct(); |
11 | 11 | |
12 | 12 | //FIXME: This is pretty much a phpUnit hack. Without it phpUnit fails here. We need a proper way to fake user/admin testing. |
@@ -80,7 +80,9 @@ discard block |
||
80 | 80 | public function __construct() { |
81 | 81 | parent::__construct(); |
82 | 82 | |
83 | - if($this->ion_auth->logged_in()) redirect('/'); |
|
83 | + if($this->ion_auth->logged_in()) { |
|
84 | + redirect('/'); |
|
85 | + } |
|
84 | 86 | } |
85 | 87 | } |
86 | 88 |
@@ -1,4 +1,4 @@ |
||
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 | /** |
4 | 4 | * Rate Limiter Configuration |
@@ -228,8 +228,8 @@ |
||
228 | 228 | //Bato.to is annoying and locks stuff behind auth. See: https://github.com/DakuTree/manga-tracker/issues/14#issuecomment-233830855 |
229 | 229 | $cookies = [ |
230 | 230 | "lang_option={$title_lang}", |
231 | - "member_id=" . $this->config->item('batoto_cookie_member_id'), |
|
232 | - "pass_hash=" . $this->config->item('batoto_cookie_pass_hash') |
|
231 | + "member_id=" . $this->config->item('batoto_cookie_member_id'), |
|
232 | + "pass_hash=" . $this->config->item('batoto_cookie_pass_hash') |
|
233 | 233 | ]; |
234 | 234 | $data = $this->get_content($title_url, implode("; ", $cookies)); |
235 | 235 | if(!$data) { |
@@ -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 | class Site_Model extends CI_Model { |
4 | 4 | public function __construct() { |
@@ -16,10 +16,10 @@ discard block |
||
16 | 16 | public function isValidTitleURL(string $title_url) : bool {} |
17 | 17 | public function isValidChapter(string $chapter): bool {} |
18 | 18 | |
19 | - protected function get_content(string $url, string $cookie_string = "", string $cookiejar_path = ""){ |
|
19 | + protected function get_content(string $url, string $cookie_string = "", string $cookiejar_path = "") { |
|
20 | 20 | $ch = curl_init(); |
21 | 21 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
22 | - curl_setopt($ch, CURLOPT_ENCODING , "gzip"); |
|
22 | + curl_setopt($ch, CURLOPT_ENCODING, "gzip"); |
|
23 | 23 | |
24 | 24 | if(!empty($cookie_string)) curl_setopt($ch, CURLOPT_COOKIE, $cookie_string); |
25 | 25 | if(!empty($cookiejar_path)) curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar_path); |
@@ -111,8 +111,8 @@ discard block |
||
111 | 111 | |
112 | 112 | $link = preg_replace('/^(.*\/)(?:[0-9]+\.html)?$/', '$1', (string) $nodes_chapter[0]->getAttribute('href')); |
113 | 113 | $chapterURLSegments = explode('/', $link); |
114 | - $titleData['latest_chapter'] = $chapterURLSegments[5] . (isset($chapterURLSegments[6]) && !empty($chapterURLSegments[6]) ? "/{$chapterURLSegments[6]}" : ""); |
|
115 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest[0]->nodeValue)); |
|
114 | + $titleData['latest_chapter'] = $chapterURLSegments[5].(isset($chapterURLSegments[6]) && !empty($chapterURLSegments[6]) ? "/{$chapterURLSegments[6]}" : ""); |
|
115 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest[0]->nodeValue)); |
|
116 | 116 | } |
117 | 117 | } else { |
118 | 118 | //TODO: Throw ERRORS; |
@@ -171,8 +171,8 @@ discard block |
||
171 | 171 | |
172 | 172 | $link = preg_replace('/^(.*\/)(?:[0-9]+\.html)?$/', '$1', (string) $nodes_chapter[0]->getAttribute('href')); |
173 | 173 | $chapterURLSegments = explode('/', $link); |
174 | - $titleData['latest_chapter'] = $chapterURLSegments[5] . (isset($chapterURLSegments[6]) && !empty($chapterURLSegments[6]) ? "/{$chapterURLSegments[6]}" : ""); |
|
175 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest[0]->nodeValue)); |
|
174 | + $titleData['latest_chapter'] = $chapterURLSegments[5].(isset($chapterURLSegments[6]) && !empty($chapterURLSegments[6]) ? "/{$chapterURLSegments[6]}" : ""); |
|
175 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest[0]->nodeValue)); |
|
176 | 176 | } |
177 | 177 | } else { |
178 | 178 | //TODO: Throw ERRORS; |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | |
213 | 213 | $chapter_parts = explode(':--:', $chapter); |
214 | 214 | return [ |
215 | - 'url' => "http://bato.to/reader#" . $chapter_parts[0], |
|
215 | + 'url' => "http://bato.to/reader#".$chapter_parts[0], |
|
216 | 216 | 'number' => $chapter_parts[1] |
217 | 217 | ]; |
218 | 218 | } |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | //Bato.to is annoying and locks stuff behind auth. See: https://github.com/DakuTree/manga-tracker/issues/14#issuecomment-233830855 |
229 | 229 | $cookies = [ |
230 | 230 | "lang_option={$title_lang}", |
231 | - "member_id=" . $this->config->item('batoto_cookie_member_id'), |
|
232 | - "pass_hash=" . $this->config->item('batoto_cookie_pass_hash') |
|
231 | + "member_id=".$this->config->item('batoto_cookie_member_id'), |
|
232 | + "pass_hash=".$this->config->item('batoto_cookie_pass_hash') |
|
233 | 233 | ]; |
234 | 234 | $data = $this->get_content($title_url, implode("; ", $cookies)); |
235 | 235 | if(!$data) { |
@@ -261,13 +261,13 @@ discard block |
||
261 | 261 | preg_match('/^(?:Vol\.(?<volume>\S+) )?(?:Ch.(?<chapter>[^\s:]+)):?.*/', trim($chapter_element->nodeValue), $text); |
262 | 262 | |
263 | 263 | $titleData['title'] = html_entity_decode(trim($xpath->query('//h1[@class="ipsType_pagetitle"]')->item(0)->nodeValue)); |
264 | - $titleData['latest_chapter'] = substr($chapter_element->getAttribute('href'), 22) . ':--:' . ((!empty($text['volume']) ? 'v'.$text['volume'].'/' : '') . 'c'.$text['chapter']); |
|
264 | + $titleData['latest_chapter'] = substr($chapter_element->getAttribute('href'), 22).':--:'.((!empty($text['volume']) ? 'v'.$text['volume'].'/' : '').'c'.$text['chapter']); |
|
265 | 265 | |
266 | 266 | $dateString = $updated_element->nodeValue; |
267 | 267 | if($dateString == 'An hour ago') { |
268 | 268 | $dateString = '1 hour ago'; |
269 | 269 | } |
270 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime(preg_replace('/ (-|\[A\]).*$/', '', $dateString))); |
|
270 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime(preg_replace('/ (-|\[A\]).*$/', '', $dateString))); |
|
271 | 271 | } else { |
272 | 272 | log_message('error', "Batoto: Regex missing <td> ({$title_url})"); |
273 | 273 | return NULL; |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | */ |
316 | 316 | |
317 | 317 | $chapterData = [ |
318 | - 'url' => 'http://dynasty-scans.com/chapters/' . $title_parts[0].'_'.$chapter, |
|
318 | + 'url' => 'http://dynasty-scans.com/chapters/'.$title_parts[0].'_'.$chapter, |
|
319 | 319 | 'number' => '' |
320 | 320 | ]; |
321 | 321 | |
@@ -355,14 +355,14 @@ discard block |
||
355 | 355 | |
356 | 356 | preg_match('/<b>.*<\/b>/', $data, $matchesT); |
357 | 357 | preg_match('/\/doujins\/[^"]+">(.+)?(?=<\/a>)<\/a>/', $data, $matchesD); |
358 | - $titleData['title'] = (!empty($matchesD) ? (substr($matchesD[1], 0, -7) !== 'Original' ? substr($matchesD[1], 0, -7).' - ' : '') : '') . substr($matchesT[0], 3, -4); |
|
358 | + $titleData['title'] = (!empty($matchesD) ? (substr($matchesD[1], 0, -7) !== 'Original' ? substr($matchesD[1], 0, -7).' - ' : '') : '').substr($matchesT[0], 3, -4); |
|
359 | 359 | |
360 | 360 | $data = preg_replace('/^[\S\s]*(<dl class=\'chapter-list\'>[\S\s]*<\/dl>)[\S\s]*$/', '$1', $data); |
361 | 361 | preg_match_all('/<dd>[\s\S]+?(?=<\/dd>)<\/dd>/', $data, $matches); |
362 | 362 | $latest_chapter_html = array_pop($matches[0]); |
363 | 363 | |
364 | 364 | preg_match('/\/chapters\/([^"]+)/', $latest_chapter_html, $matches); |
365 | - $titleData['latest_chapter'] = substr($matches[1], strlen($title_url)+1); |
|
365 | + $titleData['latest_chapter'] = substr($matches[1], strlen($title_url) + 1); |
|
366 | 366 | //FIXME: THIS IS A TEMP FIX, SEE https://github.com/DakuTree/manga-tracker/issues/58 |
367 | 367 | if(!$titleData['latest_chapter']) { |
368 | 368 | log_message('error', 'DynastyScans::getTitleData cannot parse title properly as it contains oneshot. || URL: '.$title_url); |
@@ -370,13 +370,13 @@ discard block |
||
370 | 370 | } |
371 | 371 | |
372 | 372 | preg_match('/<small>released (.*)<\/small>/', $latest_chapter_html, $matches); |
373 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime(str_replace('\'', '', $matches[1]))); |
|
373 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime(str_replace('\'', '', $matches[1]))); |
|
374 | 374 | } elseif($title_parts[1] == '1') { |
375 | 375 | $data = $this->get_content('http://dynasty-scans.com/chapters/'.$title_url); |
376 | 376 | |
377 | 377 | preg_match('/<b>.*<\/b>/', $data, $matchesT); |
378 | 378 | preg_match('/\/doujins\/[^"]+">(.+)?(?=<\/a>)<\/a>/', $data, $matchesD); |
379 | - $titleData['title'] = (!empty($matchesD) ? ($matchesD[1] !== 'Original' ? $matchesD[1].' - ' : '') : '') . substr($matchesT[0], 3, -4); |
|
379 | + $titleData['title'] = (!empty($matchesD) ? ($matchesD[1] !== 'Original' ? $matchesD[1].' - ' : '') : '').substr($matchesT[0], 3, -4); |
|
380 | 380 | |
381 | 381 | $titleData['latest_chapter'] = 'oneshot'; //This will never change |
382 | 382 | |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | $nodes_chapter = $xpath->query("td[1]/a", $nodes_row[0]); |
443 | 443 | |
444 | 444 | $titleData['latest_chapter'] = preg_replace('/^.*\/([0-9]+)$/', '$1', (string) $nodes_chapter[0]->getAttribute('href')); |
445 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest[0]->nodeValue)); |
|
445 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest[0]->nodeValue)); |
|
446 | 446 | } |
447 | 447 | } else { |
448 | 448 | //TODO: Throw ERRORS; |
@@ -500,7 +500,7 @@ discard block |
||
500 | 500 | $nodes_chapter = $xpath->query("td[1]/a", $nodes_row[0]); |
501 | 501 | |
502 | 502 | $titleData['latest_chapter'] = preg_replace('/^.*\/(.*?\/[0-9]+)\/[0-9]+$/', '$1', (string) $nodes_chapter[0]->getAttribute('href')); |
503 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest[0]->nodeValue)); |
|
503 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest[0]->nodeValue)); |
|
504 | 504 | } |
505 | 505 | } else { |
506 | 506 | //TODO: Throw ERRORS; |
@@ -565,8 +565,8 @@ discard block |
||
565 | 565 | $titleData['title'] = trim((string) $xml->channel->title); |
566 | 566 | |
567 | 567 | $chapterURLSegments = explode('/', ((string) $xml->channel->item[0]->link)); |
568 | - $titleData['latest_chapter'] = preg_replace('/^.*?([0-9]+)$/', '$1', $chapterURLSegments[7]) . ':--:' . $chapterURLSegments[6]; |
|
569 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $xml->channel->item[0]->pubDate)); |
|
568 | + $titleData['latest_chapter'] = preg_replace('/^.*?([0-9]+)$/', '$1', $chapterURLSegments[7]).':--:'.$chapterURLSegments[6]; |
|
569 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $xml->channel->item[0]->pubDate)); |
|
570 | 570 | } |
571 | 571 | } else { |
572 | 572 | //TODO: Throw ERRORS; |
@@ -645,8 +645,8 @@ discard block |
||
645 | 645 | |
646 | 646 | $link = (string) $nodes_chapter[0]->getAttribute('href'); |
647 | 647 | $chapterURLSegments = explode('/', preg_replace('/\?.*$/', '', $link)); |
648 | - $titleData['latest_chapter'] = $chapterURLSegments[3] . ':--:' . preg_replace('/.*?([0-9]+)$/', '$1', $link); |
|
649 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest[0]->textContent)); |
|
648 | + $titleData['latest_chapter'] = $chapterURLSegments[3].':--:'.preg_replace('/.*?([0-9]+)$/', '$1', $link); |
|
649 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) $nodes_latest[0]->textContent)); |
|
650 | 650 | } |
651 | 651 | } else { |
652 | 652 | //TODO: Throw ERRORS; |
@@ -681,7 +681,7 @@ discard block |
||
681 | 681 | $chapter_parts = explode('/', $chapter); |
682 | 682 | return [ |
683 | 683 | 'url' => "https://reader.kireicake.com/read/{$title_url}/{$chapter}", |
684 | - 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
684 | + 'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '')."c{$chapter_parts[2]}".(isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/ |
|
685 | 685 | ]; |
686 | 686 | } |
687 | 687 | |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | |
713 | 713 | $link = (string) $nodes_chapter[0]->getAttribute('href'); |
714 | 714 | $titleData['latest_chapter'] = preg_replace('/.*\/read\/.*?\/(.*?)\/$/', '$1', $link); |
715 | - $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) str_replace('.', '', explode(',', $nodes_latest[0]->textContent)[1]))); |
|
715 | + $titleData['last_updated'] = date("Y-m-d H:i:s", strtotime((string) str_replace('.', '', explode(',', $nodes_latest[0]->textContent)[1]))); |
|
716 | 716 | } |
717 | 717 | } else { |
718 | 718 | //TODO: Throw ERRORS; |
@@ -16,13 +16,17 @@ discard block |
||
16 | 16 | public function isValidTitleURL(string $title_url) : bool {} |
17 | 17 | public function isValidChapter(string $chapter): bool {} |
18 | 18 | |
19 | - protected function get_content(string $url, string $cookie_string = "", string $cookiejar_path = ""){ |
|
19 | + protected function get_content(string $url, string $cookie_string = "", string $cookiejar_path = "") { |
|
20 | 20 | $ch = curl_init(); |
21 | 21 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
22 | 22 | curl_setopt($ch, CURLOPT_ENCODING , "gzip"); |
23 | 23 | |
24 | - if(!empty($cookie_string)) curl_setopt($ch, CURLOPT_COOKIE, $cookie_string); |
|
25 | - if(!empty($cookiejar_path)) curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar_path); |
|
24 | + if(!empty($cookie_string)) { |
|
25 | + curl_setopt($ch, CURLOPT_COOKIE, $cookie_string); |
|
26 | + } |
|
27 | + if(!empty($cookiejar_path)) { |
|
28 | + curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar_path); |
|
29 | + } |
|
26 | 30 | |
27 | 31 | //Some sites check the useragent for stuff, use a pre-defined user-agent to avoid stuff. |
28 | 32 | curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2824.0 Safari/537.36'); |
@@ -68,12 +72,16 @@ discard block |
||
68 | 72 | |
69 | 73 | public function isValidTitleURL(string $title_url) : bool { |
70 | 74 | $success = (bool) preg_match('/^[a-z0-9_]+$/', $title_url); |
71 | - if(!$success) log_message('error', "Invalid Title URL (MangaFox): {$title_url}"); |
|
75 | + if(!$success) { |
|
76 | + log_message('error', "Invalid Title URL (MangaFox): {$title_url}"); |
|
77 | + } |
|
72 | 78 | return $success; |
73 | 79 | } |
74 | 80 | public function isValidChapter(string $chapter) : bool { |
75 | 81 | $success = (bool) preg_match('/^(?:v[0-9a-zA-Z]+\/)?c[0-9\.]+$/', $chapter); |
76 | - if(!$success) log_message('error', 'Invalid Chapter (MangaFox): '.$chapter); |
|
82 | + if(!$success) { |
|
83 | + log_message('error', 'Invalid Chapter (MangaFox): '.$chapter); |
|
84 | + } |
|
77 | 85 | return $success; |
78 | 86 | } |
79 | 87 | |
@@ -129,12 +137,16 @@ discard block |
||
129 | 137 | |
130 | 138 | public function isValidTitleURL(string $title_url) : bool { |
131 | 139 | $success = (bool) preg_match('/^[a-z0-9_]+$/', $title_url); |
132 | - if(!$success) log_message('error', "Invalid Title URL (MangaFox): {$title_url}"); |
|
140 | + if(!$success) { |
|
141 | + log_message('error', "Invalid Title URL (MangaFox): {$title_url}"); |
|
142 | + } |
|
133 | 143 | return $success; |
134 | 144 | } |
135 | 145 | public function isValidChapter(string $chapter) : bool { |
136 | 146 | $success = (bool) preg_match('/^(?:v[0-9]+\/)?c[0-9]+(?:\.[0-9]+)?$/', $chapter); |
137 | - if(!$success) log_message('error', 'Invalid Chapter (MangaFox): '.$chapter); |
|
147 | + if(!$success) { |
|
148 | + log_message('error', 'Invalid Chapter (MangaFox): '.$chapter); |
|
149 | + } |
|
138 | 150 | return $success; |
139 | 151 | } |
140 | 152 | |
@@ -195,7 +207,9 @@ discard block |
||
195 | 207 | |
196 | 208 | public function isValidTitleURL(string $title_url) : bool { |
197 | 209 | $success = (bool) preg_match('/^[a-z0-9%-]+:--:(?:English|Spanish|French|German|Portuguese|Turkish|Indonesian|Greek|Filipino|Italian|Polish|Thai|Malay|Hungarian|Romanian|Arabic|Hebrew|Russian|Vietnamese|Dutch)$/', $title_url); |
198 | - if(!$success) log_message('error', "Invalid Title URL (Batoto): {$title_url}"); |
|
210 | + if(!$success) { |
|
211 | + log_message('error', "Invalid Title URL (Batoto): {$title_url}"); |
|
212 | + } |
|
199 | 213 | return $success; |
200 | 214 | } |
201 | 215 | public function isValidChapter(string $chapter) : bool { |
@@ -203,7 +217,9 @@ discard block |
||
203 | 217 | // Preferably we'd just use /^[0-9a-z]+:--:(v[0-9]+\/)?c[0-9]+(\.[0-9]+)?$/ |
204 | 218 | |
205 | 219 | $success = (bool) preg_match('/^[0-9a-z]+:--:.+$/', $chapter); |
206 | - if(!$success) log_message('error', 'Invalid Chapter (Batoto): '.$chapter); |
|
220 | + if(!$success) { |
|
221 | + log_message('error', 'Invalid Chapter (Batoto): '.$chapter); |
|
222 | + } |
|
207 | 223 | return $success; |
208 | 224 | } |
209 | 225 | |
@@ -296,12 +312,16 @@ discard block |
||
296 | 312 | |
297 | 313 | public function isValidTitleURL(string $title_url) : bool { |
298 | 314 | $success = (bool) preg_match('/^[a-z0-9_]+:--:(?:0|1)$/', $title_url); |
299 | - if(!$success) log_message('error', "Invalid Title URL (DynastyScans): {$title_url}"); |
|
315 | + if(!$success) { |
|
316 | + log_message('error', "Invalid Title URL (DynastyScans): {$title_url}"); |
|
317 | + } |
|
300 | 318 | return $success; |
301 | 319 | } |
302 | 320 | public function isValidChapter(string $chapter) : bool { |
303 | 321 | $success = (bool) preg_match('/^[0-9a-z_]+$/', $chapter); |
304 | - if(!$success) log_message('error', 'Invalid Chapter (DynastyScans): '.$chapter); |
|
322 | + if(!$success) { |
|
323 | + log_message('error', 'Invalid Chapter (DynastyScans): '.$chapter); |
|
324 | + } |
|
305 | 325 | return $success; |
306 | 326 | } |
307 | 327 | |
@@ -407,12 +427,16 @@ discard block |
||
407 | 427 | |
408 | 428 | public function isValidTitleURL(string $title_url) : bool { |
409 | 429 | $success = (bool) preg_match('/^[a-z0-9-]+$/', $title_url); |
410 | - if(!$success) log_message('error', "Invalid Title URL (MangaPanda): {$title_url}"); |
|
430 | + if(!$success) { |
|
431 | + log_message('error', "Invalid Title URL (MangaPanda): {$title_url}"); |
|
432 | + } |
|
411 | 433 | return $success; |
412 | 434 | } |
413 | 435 | public function isValidChapter(string $chapter) : bool { |
414 | 436 | $success = (bool) preg_match('/^[0-9]+$/', $chapter); |
415 | - if(!$success) log_message('error', 'Invalid Chapter (MangaPanda): '.$chapter); |
|
437 | + if(!$success) { |
|
438 | + log_message('error', 'Invalid Chapter (MangaPanda): '.$chapter); |
|
439 | + } |
|
416 | 440 | return $success; |
417 | 441 | } |
418 | 442 | |
@@ -459,12 +483,16 @@ discard block |
||
459 | 483 | |
460 | 484 | public function isValidTitleURL(string $title_url) : bool { |
461 | 485 | $success = (bool) preg_match('/^[a-z0-9_]+$/', $title_url); |
462 | - if(!$success) log_message('error', "Invalid Title URL (MangaStream): {$title_url}"); |
|
486 | + if(!$success) { |
|
487 | + log_message('error', "Invalid Title URL (MangaStream): {$title_url}"); |
|
488 | + } |
|
463 | 489 | return $success; |
464 | 490 | } |
465 | 491 | public function isValidChapter(string $chapter) : bool { |
466 | 492 | $success = (bool) preg_match('/^(.*?)\/[0-9]+$/', $chapter); |
467 | - if(!$success) log_message('error', 'Invalid Chapter (MangaStream): '.$chapter); |
|
493 | + if(!$success) { |
|
494 | + log_message('error', 'Invalid Chapter (MangaStream): '.$chapter); |
|
495 | + } |
|
468 | 496 | return $success; |
469 | 497 | } |
470 | 498 | |
@@ -533,12 +561,16 @@ discard block |
||
533 | 561 | |
534 | 562 | public function isValidTitleURL(string $title_url) : bool { |
535 | 563 | $success = (bool) preg_match('/^[0-9]+:--:(?:en|zh-hant|zh-hans|th|id):--:[a-z0-9-]+:--:(?:drama|fantasy|comedy|action|slice-of-life|romance|superhero|thriller|sports|sci-fi)$/', $title_url); |
536 | - if(!$success) log_message('error', "Invalid Title URL (WebToons): {$title_url}"); |
|
564 | + if(!$success) { |
|
565 | + log_message('error', "Invalid Title URL (WebToons): {$title_url}"); |
|
566 | + } |
|
537 | 567 | return $success; |
538 | 568 | } |
539 | 569 | public function isValidChapter(string $chapter) : bool { |
540 | 570 | $success = (bool) preg_match('/^[0-9]+:--:.*$/', $chapter); |
541 | - if(!$success) log_message('error', 'Invalid Chapter (WebToons): '.$chapter); |
|
571 | + if(!$success) { |
|
572 | + log_message('error', 'Invalid Chapter (WebToons): '.$chapter); |
|
573 | + } |
|
542 | 574 | return $success; |
543 | 575 | } |
544 | 576 | |
@@ -595,12 +627,16 @@ discard block |
||
595 | 627 | |
596 | 628 | public function isValidTitleURL(string $title_url) : bool { |
597 | 629 | $success = (bool) preg_match('/^[A-Za-z0-9-]+/', $title_url); |
598 | - if(!$success) log_message('error', "Invalid Title URL (KissManga): {$title_url}"); |
|
630 | + if(!$success) { |
|
631 | + log_message('error', "Invalid Title URL (KissManga): {$title_url}"); |
|
632 | + } |
|
599 | 633 | return $success; |
600 | 634 | } |
601 | 635 | public function isValidChapter(string $chapter) : bool { |
602 | 636 | $success = (bool) preg_match('/^.*?:--:[0-9]+$/', $chapter); |
603 | - if(!$success) log_message('error', 'Invalid Chapter (KissManga): '.$chapter); |
|
637 | + if(!$success) { |
|
638 | + log_message('error', 'Invalid Chapter (KissManga): '.$chapter); |
|
639 | + } |
|
604 | 640 | return $success; |
605 | 641 | } |
606 | 642 | |
@@ -667,12 +703,16 @@ discard block |
||
667 | 703 | |
668 | 704 | public function isValidTitleURL(string $title_url) : bool { |
669 | 705 | $success = (bool) preg_match('/^[a-z0-9_]+/', $title_url); |
670 | - if(!$success) log_message('error', "Invalid Title URL (KireiCake): {$title_url}"); |
|
706 | + if(!$success) { |
|
707 | + log_message('error', "Invalid Title URL (KireiCake): {$title_url}"); |
|
708 | + } |
|
671 | 709 | return $success; |
672 | 710 | } |
673 | 711 | public function isValidChapter(string $chapter) : bool { |
674 | 712 | $success = (bool) preg_match('/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/', $chapter); |
675 | - if(!$success) log_message('error', 'Invalid Chapter (KireiCake): '.$chapter); |
|
713 | + if(!$success) { |
|
714 | + log_message('error', 'Invalid Chapter (KireiCake): '.$chapter); |
|
715 | + } |
|
676 | 716 | return $success; |
677 | 717 | } |
678 | 718 |
@@ -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 | class Site_Model extends CI_Model { |
4 | 4 | public function __construct() { |
@@ -94,9 +94,9 @@ discard block |
||
94 | 94 | //$data = preg_replace('/^[\S\s]*(<body id="body">[\S\s]*<\/body>)[\S\s]*$/', '$1', $data); |
95 | 95 | |
96 | 96 | $dom = new DOMDocument(); |
97 | - libxml_use_internal_errors(true); |
|
97 | + libxml_use_internal_errors(TRUE); |
|
98 | 98 | $dom->loadHTML($data); |
99 | - libxml_use_internal_errors(false); |
|
99 | + libxml_use_internal_errors(FALSE); |
|
100 | 100 | |
101 | 101 | $xpath = new DOMXPath($dom); |
102 | 102 | |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | //$data = preg_replace('/^[\S\s]*(<body id="body">[\S\s]*<\/body>)[\S\s]*$/', '$1', $data); |
156 | 156 | |
157 | 157 | $dom = new DOMDocument(); |
158 | - libxml_use_internal_errors(true); |
|
158 | + libxml_use_internal_errors(TRUE); |
|
159 | 159 | $dom->loadHTML($data); |
160 | - libxml_use_internal_errors(false); |
|
160 | + libxml_use_internal_errors(FALSE); |
|
161 | 161 | |
162 | 162 | $xpath = new DOMXPath($dom); |
163 | 163 | $nodes_title = $xpath->query("//meta[@property='og:title']"); |
@@ -243,9 +243,9 @@ discard block |
||
243 | 243 | if(strpos($data, '>Register now<') === FALSE) { |
244 | 244 | //Auth was successful |
245 | 245 | $dom = new DOMDocument(); |
246 | - libxml_use_internal_errors(true); |
|
246 | + libxml_use_internal_errors(TRUE); |
|
247 | 247 | $dom->loadHTML($data); |
248 | - libxml_use_internal_errors(false); |
|
248 | + libxml_use_internal_errors(FALSE); |
|
249 | 249 | |
250 | 250 | $xpath = new DOMXPath($dom); |
251 | 251 | $nodes = $xpath->query("(//div/div)[last()]/table/tbody/tr[2]"); |
@@ -426,9 +426,9 @@ discard block |
||
426 | 426 | //$data = preg_replace('/^[\S\s]*(<body id="body">[\S\s]*<\/body>)[\S\s]*$/', '$1', $data); |
427 | 427 | |
428 | 428 | $dom = new DOMDocument(); |
429 | - libxml_use_internal_errors(true); |
|
429 | + libxml_use_internal_errors(TRUE); |
|
430 | 430 | $dom->loadHTML($data); |
431 | - libxml_use_internal_errors(false); |
|
431 | + libxml_use_internal_errors(FALSE); |
|
432 | 432 | |
433 | 433 | $xpath = new DOMXPath($dom); |
434 | 434 | |
@@ -485,9 +485,9 @@ discard block |
||
485 | 485 | //$data = preg_replace('/^[\S\s]*(<body id="body">[\S\s]*<\/body>)[\S\s]*$/', '$1', $data); |
486 | 486 | |
487 | 487 | $dom = new DOMDocument(); |
488 | - libxml_use_internal_errors(true); |
|
488 | + libxml_use_internal_errors(TRUE); |
|
489 | 489 | $dom->loadHTML($data); |
490 | - libxml_use_internal_errors(false); |
|
490 | + libxml_use_internal_errors(FALSE); |
|
491 | 491 | |
492 | 492 | $xpath = new DOMXPath($dom); |
493 | 493 | |
@@ -629,9 +629,9 @@ discard block |
||
629 | 629 | $data = preg_replace('/^[\S\s]*(<div id="leftside">[\S\s]*)<div id="rightside">[\S\s]*$/', '$1', $data); |
630 | 630 | |
631 | 631 | $dom = new DOMDocument(); |
632 | - libxml_use_internal_errors(true); |
|
632 | + libxml_use_internal_errors(TRUE); |
|
633 | 633 | $dom->loadHTML($data); |
634 | - libxml_use_internal_errors(false); |
|
634 | + libxml_use_internal_errors(FALSE); |
|
635 | 635 | |
636 | 636 | $xpath = new DOMXPath($dom); |
637 | 637 | |
@@ -695,9 +695,9 @@ discard block |
||
695 | 695 | $data = preg_replace('/^[\S\s]*(<article>[\S\s]*)<\/article>[\S\s]*$/', '$1', $data); |
696 | 696 | |
697 | 697 | $dom = new DOMDocument(); |
698 | - libxml_use_internal_errors(true); |
|
698 | + libxml_use_internal_errors(TRUE); |
|
699 | 699 | $dom->loadHTML($data); |
700 | - libxml_use_internal_errors(false); |
|
700 | + libxml_use_internal_errors(FALSE); |
|
701 | 701 | |
702 | 702 | $xpath = new DOMXPath($dom); |
703 | 703 |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | $this->load->database(); |
41 | 41 | |
42 | 42 | $query = $this->db->select('*') |
43 | - ->from('auth_users') |
|
44 | - ->where('username', $username) |
|
45 | - ->get(); |
|
43 | + ->from('auth_users') |
|
44 | + ->where('username', $username) |
|
45 | + ->get(); |
|
46 | 46 | |
47 | 47 | return (bool) $query->num_rows(); |
48 | 48 | } |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | $this->load->database(); |
65 | 65 | |
66 | 66 | $query = $this->db->select('email') |
67 | - ->from('auth_users') |
|
68 | - ->where('username', $identity) |
|
69 | - ->get(); |
|
67 | + ->from('auth_users') |
|
68 | + ->where('username', $identity) |
|
69 | + ->get(); |
|
70 | 70 | |
71 | 71 | if($query->num_rows() > 0) { |
72 | 72 | //username exists, grab email |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | $user = NULL; |
85 | 85 | |
86 | 86 | $query = $this->db->select('*') |
87 | - ->from('auth_users') |
|
88 | - ->where('username', $username) |
|
89 | - ->get(); |
|
87 | + ->from('auth_users') |
|
88 | + ->where('username', $username) |
|
89 | + ->get(); |
|
90 | 90 | |
91 | 91 | if($query->num_rows() > 0) { |
92 | 92 | $user = $query->row(); |
@@ -114,9 +114,9 @@ discard block |
||
114 | 114 | |
115 | 115 | public function get_id_from_api_key(string $api_key) { |
116 | 116 | $query = $this->db->select('id') |
117 | - ->from('auth_users') |
|
118 | - ->where('api_key', $api_key) |
|
119 | - ->get(); |
|
117 | + ->from('auth_users') |
|
118 | + ->where('api_key', $api_key) |
|
119 | + ->get(); |
|
120 | 120 | |
121 | 121 | if($query->num_rows() > 0) { |
122 | 122 | $userID = $query->row('id'); |
@@ -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 | class User_Model extends CI_Model { |
4 | 4 | public $id; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | if($query->num_rows() > 0) { |
72 | 72 | //username exists, grab email |
73 | 73 | $email = $query->row('email'); |
74 | - }else{ |
|
74 | + } else { |
|
75 | 75 | //username doesn't exist, return FALSE |
76 | 76 | $email = FALSE; |
77 | 77 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | public function get_new_api_key() : string { |
104 | 104 | $api_key = NULL; |
105 | 105 | if($this->logged_in()) { |
106 | - $api_key = substr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", mt_rand(0, 51), 1) . substr(md5((string) time()), 1); |
|
106 | + $api_key = substr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", mt_rand(0, 51), 1).substr(md5((string) time()), 1); |
|
107 | 107 | |
108 | 108 | $this->db->where('id', $this->id); |
109 | 109 | $this->db->update('auth_users', ['api_key' => $api_key]); |
@@ -71,7 +71,7 @@ |
||
71 | 71 | if($query->num_rows() > 0) { |
72 | 72 | //username exists, grab email |
73 | 73 | $email = $query->row('email'); |
74 | - }else{ |
|
74 | + } else { |
|
75 | 75 | //username doesn't exist, return FALSE |
76 | 76 | $email = FALSE; |
77 | 77 | } |
@@ -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 User_Model extends CI_Model { |
4 | 4 | public $id; |
@@ -11,14 +11,14 @@ |
||
11 | 11 | |
12 | 12 | $config['gravatar_base_url'] = 'http://www.gravatar.com/'; |
13 | 13 | $config['gravatar_secure_base_url'] = 'https://secure.gravatar.com/'; |
14 | -$config['gravatar_image_extension'] = '.png'; // '', '.png' or '.jpg'. |
|
14 | +$config['gravatar_image_extension'] = '.png'; // '', '.png' or '.jpg'. |
|
15 | 15 | $config['gravatar_image_size'] = 44; |
16 | 16 | |
17 | 17 | $config['gravatar_default_image'] = 'identicon'; // '', '404', 'mm', 'identicon', 'monsterid', 'wavatar', 'retro', 'blank'. |
18 | 18 | //$config['gravatar_default_image'] = BASE_URL.'assets/img/lib/default-person.png'; // Another possible option: a custon image. |
19 | 19 | |
20 | 20 | $config['gravatar_force_default_image'] = false; |
21 | -$config['gravatar_rating'] = ''; // '', 'g' (default), 'pg', 'r', 'x'. |
|
21 | +$config['gravatar_rating'] = ''; // '', 'g' (default), 'pg', 'r', 'x'. |
|
22 | 22 | |
23 | 23 | // Useragent string for server-made requests. |
24 | 24 | // It is for not getting 403 forbidden response. |
@@ -1,4 +1,4 @@ discard block |
||
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 | /** |
4 | 4 | * Gravatar Library for CodeIgniter - Configuration |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $config['gravatar_default_image'] = 'identicon'; // '', '404', 'mm', 'identicon', 'monsterid', 'wavatar', 'retro', 'blank'. |
18 | 18 | //$config['gravatar_default_image'] = BASE_URL.'assets/img/lib/default-person.png'; // Another possible option: a custon image. |
19 | 19 | |
20 | -$config['gravatar_force_default_image'] = false; |
|
20 | +$config['gravatar_force_default_image'] = FALSE; |
|
21 | 21 | $config['gravatar_rating'] = ''; // '', 'g' (default), 'pg', 'r', 'x'. |
22 | 22 | |
23 | 23 | // Useragent string for server-made requests. |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | | salt_prefix: Used for bcrypt. Versions of PHP before 5.3.7 only support "$2a$" as the salt prefix |
67 | 67 | | Versions 5.3.7 or greater should use the default of "$2y$". |
68 | 68 | */ |
69 | -$config['hash_method'] = 'bcrypt'; // sha1 or bcrypt, bcrypt is STRONGLY recommended |
|
70 | -$config['default_rounds'] = 8; // This does not apply if random_rounds is set to true |
|
69 | +$config['hash_method'] = 'bcrypt'; // sha1 or bcrypt, bcrypt is STRONGLY recommended |
|
70 | +$config['default_rounds'] = 8; // This does not apply if random_rounds is set to true |
|
71 | 71 | $config['random_rounds'] = FALSE; |
72 | 72 | $config['min_rounds'] = 5; |
73 | 73 | $config['max_rounds'] = 9; |
@@ -82,22 +82,22 @@ discard block |
||
82 | 82 | | The controller should check this function and act |
83 | 83 | | appropriately. If this variable set to 0, there is no maximum. |
84 | 84 | */ |
85 | -$config['site_title'] = "Manga Tracker"; // Site Title, example.com |
|
86 | -$config['admin_email'] = "[email protected]"; // Admin Email, [email protected] //TODO: Change later. |
|
87 | -$config['default_group'] = 'members'; // Default group, use name |
|
88 | -$config['admin_group'] = 'admin'; // Default administrators group, use name |
|
89 | -$config['identity'] = 'email'; // [NOTE: username can be used too] You can use any unique column in your table as identity column. The values in this column, alongside password, will be used for login purposes |
|
90 | -$config['min_password_length'] = 6; // Minimum Required Length of Password |
|
91 | -$config['max_password_length'] = 64; // Maximum Allowed Length of Password //TODO: Enable later. |
|
92 | -$config['email_activation'] = FALSE; // Email Activation for registration |
|
93 | -$config['manual_activation'] = FALSE; // Manual Activation for registration |
|
94 | -$config['remember_users'] = TRUE; // Allow users to be remembered and enable auto-login |
|
95 | -$config['user_expire'] = 86500; // How long to remember the user (seconds). Set to zero for no expiration |
|
96 | -$config['user_extend_on_login'] = TRUE; // Extend the users cookies every time they auto-login |
|
97 | -$config['track_login_attempts'] = FALSE; // Track the number of failed login attempts for each user or ip. |
|
98 | -$config['track_login_ip_address'] = TRUE; // Track login attempts by IP Address, if FALSE will track based on identity. (Default: TRUE) |
|
99 | -$config['maximum_login_attempts'] = 3; // The maximum number of failed login attempts. |
|
100 | -$config['lockout_time'] = 600; // The number of seconds to lockout an account due to exceeded attempts |
|
85 | +$config['site_title'] = "Manga Tracker"; // Site Title, example.com |
|
86 | +$config['admin_email'] = "[email protected]"; // Admin Email, [email protected] //TODO: Change later. |
|
87 | +$config['default_group'] = 'members'; // Default group, use name |
|
88 | +$config['admin_group'] = 'admin'; // Default administrators group, use name |
|
89 | +$config['identity'] = 'email'; // [NOTE: username can be used too] You can use any unique column in your table as identity column. The values in this column, alongside password, will be used for login purposes |
|
90 | +$config['min_password_length'] = 6; // Minimum Required Length of Password |
|
91 | +$config['max_password_length'] = 64; // Maximum Allowed Length of Password //TODO: Enable later. |
|
92 | +$config['email_activation'] = FALSE; // Email Activation for registration |
|
93 | +$config['manual_activation'] = FALSE; // Manual Activation for registration |
|
94 | +$config['remember_users'] = TRUE; // Allow users to be remembered and enable auto-login |
|
95 | +$config['user_expire'] = 86500; // How long to remember the user (seconds). Set to zero for no expiration |
|
96 | +$config['user_extend_on_login'] = TRUE; // Extend the users cookies every time they auto-login |
|
97 | +$config['track_login_attempts'] = FALSE; // Track the number of failed login attempts for each user or ip. |
|
98 | +$config['track_login_ip_address'] = TRUE; // Track login attempts by IP Address, if FALSE will track based on identity. (Default: TRUE) |
|
99 | +$config['maximum_login_attempts'] = 3; // The maximum number of failed login attempts. |
|
100 | +$config['lockout_time'] = 600; // The number of seconds to lockout an account due to exceeded attempts |
|
101 | 101 | $config['forgot_password_expiration'] = 43200000; /*12HR*/ // The number of milliseconds after which a forgot password request will expire. If set to 0, forgot password requests will not expire. |
102 | 102 | |
103 | 103 | /* |
@@ -175,11 +175,11 @@ discard block |
||
175 | 175 | | Message Delimiters. |
176 | 176 | | ------------------------------------------------------------------------- |
177 | 177 | */ |
178 | -$config['delimiters_source'] = 'config'; // "config" = use the settings defined here, "form_validation" = use the settings defined in CI's form validation library |
|
179 | -$config['message_start_delimiter'] = '<p>'; // Message start delimiter |
|
180 | -$config['message_end_delimiter'] = '</p>'; // Message end delimiter |
|
181 | -$config['error_start_delimiter'] = '<p>'; // Error message start delimiter |
|
182 | -$config['error_end_delimiter'] = '</p>'; // Error message end delimiter |
|
178 | +$config['delimiters_source'] = 'config'; // "config" = use the settings defined here, "form_validation" = use the settings defined in CI's form validation library |
|
179 | +$config['message_start_delimiter'] = '<p>'; // Message start delimiter |
|
180 | +$config['message_end_delimiter'] = '</p>'; // Message end delimiter |
|
181 | +$config['error_start_delimiter'] = '<p>'; // Error message start delimiter |
|
182 | +$config['error_end_delimiter'] = '</p>'; // Error message end delimiter |
|
183 | 183 | |
184 | 184 | /* End of file ion_auth.php */ |
185 | 185 | /* Location: ./application/config/ion_auth.php */ |
@@ -1,4 +1,4 @@ |
||
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 | /** |
4 | 4 | * Rate Limiter Configuration |
@@ -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,13 +73,13 @@ 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 |
@@ -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,13 +73,13 @@ 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 |
@@ -76,7 +76,7 @@ |
||
76 | 76 | 'jpeg' => array('image/jpeg', 'image/pjpeg'), |
77 | 77 | 'jpg' => array('image/jpeg', 'image/pjpeg'), |
78 | 78 | 'jpe' => array('image/jpeg', 'image/pjpeg'), |
79 | - 'png' => array('image/png', 'image/x-png'), |
|
79 | + 'png' => array('image/png', 'image/x-png'), |
|
80 | 80 | 'tiff' => 'image/tiff', |
81 | 81 | 'tif' => 'image/tiff', |
82 | 82 | 'css' => array('text/css', 'text/plain'), |
@@ -1,4 +1,4 @@ |
||
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 | /** |
4 | 4 | * Rate Limiter Configuration |
@@ -17,48 +17,48 @@ |
||
17 | 17 | |
18 | 18 | // smiley image name width height alt |
19 | 19 | |
20 | - ':-)' => array('grin.gif', '19', '19', 'grin'), |
|
21 | - ':lol:' => array('lol.gif', '19', '19', 'LOL'), |
|
22 | - ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), |
|
23 | - ':)' => array('smile.gif', '19', '19', 'smile'), |
|
24 | - ';-)' => array('wink.gif', '19', '19', 'wink'), |
|
25 | - ';)' => array('wink.gif', '19', '19', 'wink'), |
|
26 | - ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), |
|
27 | - ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), |
|
28 | - ':-S' => array('confused.gif', '19', '19', 'confused'), |
|
29 | - ':wow:' => array('surprise.gif', '19', '19', 'surprised'), |
|
30 | - ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), |
|
31 | - ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), |
|
32 | - '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), |
|
33 | - ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), |
|
34 | - ':P' => array('raspberry.gif', '19', '19', 'raspberry'), |
|
35 | - ':blank:' => array('blank.gif', '19', '19', 'blank stare'), |
|
36 | - ':long:' => array('longface.gif', '19', '19', 'long face'), |
|
37 | - ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), |
|
38 | - ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), |
|
39 | - ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), |
|
40 | - '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), |
|
41 | - ':down:' => array('downer.gif', '19', '19', 'downer'), |
|
42 | - ':red:' => array('embarrassed.gif', '19', '19', 'red face'), |
|
43 | - ':sick:' => array('sick.gif', '19', '19', 'sick'), |
|
44 | - ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), |
|
45 | - ':-/' => array('hmm.gif', '19', '19', 'hmmm'), |
|
46 | - '>:(' => array('mad.gif', '19', '19', 'mad'), |
|
47 | - ':mad:' => array('mad.gif', '19', '19', 'mad'), |
|
48 | - '>:-(' => array('angry.gif', '19', '19', 'angry'), |
|
49 | - ':angry:' => array('angry.gif', '19', '19', 'angry'), |
|
50 | - ':zip:' => array('zip.gif', '19', '19', 'zipper'), |
|
51 | - ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), |
|
52 | - ':ahhh:' => array('shock.gif', '19', '19', 'shock'), |
|
53 | - ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), |
|
54 | - ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), |
|
55 | - ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), |
|
56 | - ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), |
|
57 | - ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), |
|
58 | - ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), |
|
59 | - ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), |
|
60 | - ':snake:' => array('snake.gif', '19', '19', 'snake'), |
|
61 | - ':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'), |
|
62 | - ':question:' => array('question.gif', '19', '19', 'question') |
|
20 | + ':-)' => array('grin.gif', '19', '19', 'grin'), |
|
21 | + ':lol:' => array('lol.gif', '19', '19', 'LOL'), |
|
22 | + ':cheese:' => array('cheese.gif', '19', '19', 'cheese'), |
|
23 | + ':)' => array('smile.gif', '19', '19', 'smile'), |
|
24 | + ';-)' => array('wink.gif', '19', '19', 'wink'), |
|
25 | + ';)' => array('wink.gif', '19', '19', 'wink'), |
|
26 | + ':smirk:' => array('smirk.gif', '19', '19', 'smirk'), |
|
27 | + ':roll:' => array('rolleyes.gif', '19', '19', 'rolleyes'), |
|
28 | + ':-S' => array('confused.gif', '19', '19', 'confused'), |
|
29 | + ':wow:' => array('surprise.gif', '19', '19', 'surprised'), |
|
30 | + ':bug:' => array('bigsurprise.gif', '19', '19', 'big surprise'), |
|
31 | + ':-P' => array('tongue_laugh.gif', '19', '19', 'tongue laugh'), |
|
32 | + '%-P' => array('tongue_rolleye.gif', '19', '19', 'tongue rolleye'), |
|
33 | + ';-P' => array('tongue_wink.gif', '19', '19', 'tongue wink'), |
|
34 | + ':P' => array('raspberry.gif', '19', '19', 'raspberry'), |
|
35 | + ':blank:' => array('blank.gif', '19', '19', 'blank stare'), |
|
36 | + ':long:' => array('longface.gif', '19', '19', 'long face'), |
|
37 | + ':ohh:' => array('ohh.gif', '19', '19', 'ohh'), |
|
38 | + ':grrr:' => array('grrr.gif', '19', '19', 'grrr'), |
|
39 | + ':gulp:' => array('gulp.gif', '19', '19', 'gulp'), |
|
40 | + '8-/' => array('ohoh.gif', '19', '19', 'oh oh'), |
|
41 | + ':down:' => array('downer.gif', '19', '19', 'downer'), |
|
42 | + ':red:' => array('embarrassed.gif', '19', '19', 'red face'), |
|
43 | + ':sick:' => array('sick.gif', '19', '19', 'sick'), |
|
44 | + ':shut:' => array('shuteye.gif', '19', '19', 'shut eye'), |
|
45 | + ':-/' => array('hmm.gif', '19', '19', 'hmmm'), |
|
46 | + '>:(' => array('mad.gif', '19', '19', 'mad'), |
|
47 | + ':mad:' => array('mad.gif', '19', '19', 'mad'), |
|
48 | + '>:-(' => array('angry.gif', '19', '19', 'angry'), |
|
49 | + ':angry:' => array('angry.gif', '19', '19', 'angry'), |
|
50 | + ':zip:' => array('zip.gif', '19', '19', 'zipper'), |
|
51 | + ':kiss:' => array('kiss.gif', '19', '19', 'kiss'), |
|
52 | + ':ahhh:' => array('shock.gif', '19', '19', 'shock'), |
|
53 | + ':coolsmile:' => array('shade_smile.gif', '19', '19', 'cool smile'), |
|
54 | + ':coolsmirk:' => array('shade_smirk.gif', '19', '19', 'cool smirk'), |
|
55 | + ':coolgrin:' => array('shade_grin.gif', '19', '19', 'cool grin'), |
|
56 | + ':coolhmm:' => array('shade_hmm.gif', '19', '19', 'cool hmm'), |
|
57 | + ':coolmad:' => array('shade_mad.gif', '19', '19', 'cool mad'), |
|
58 | + ':coolcheese:' => array('shade_cheese.gif', '19', '19', 'cool cheese'), |
|
59 | + ':vampire:' => array('vampire.gif', '19', '19', 'vampire'), |
|
60 | + ':snake:' => array('snake.gif', '19', '19', 'snake'), |
|
61 | + ':exclaim:' => array('exclaim.gif', '19', '19', 'exclaim'), |
|
62 | + ':question:' => array('question.gif', '19', '19', 'question') |
|
63 | 63 | |
64 | 64 | ); |
@@ -1,5 +1,5 @@ |
||
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 | | ------------------------------------------------------------------------- |