@@ -297,14 +297,16 @@ |
||
297 | 297 | $str = ''; |
298 | 298 | foreach ($trace as $caller) { |
299 | 299 | $str .= " -- Called by {$caller['function']}"; |
300 | - if (isset($caller['class'])) |
|
301 | - $str .= " From Class {$caller['class']}"; |
|
300 | + if (isset($caller['class'])) { |
|
301 | + $str .= " From Class {$caller['class']}"; |
|
302 | + } |
|
302 | 303 | } |
303 | 304 | } else { |
304 | 305 | $caller = $trace[2]; |
305 | 306 | $str = "Called by {$caller['function']}"; |
306 | - if (isset($caller['class'])) |
|
307 | - $str .= " From Class {$caller['class']}"; |
|
307 | + if (isset($caller['class'])) { |
|
308 | + $str .= " From Class {$caller['class']}"; |
|
309 | + } |
|
308 | 310 | } |
309 | 311 | return $str; |
310 | 312 | } |
@@ -7,7 +7,9 @@ |
||
7 | 7 | $row = $pdo->row_array(); |
8 | 8 | $row = array_map(function ($db) { |
9 | 9 | if (isset($db['msisdn'])) { |
10 | - if (strlen($db['msisdn']) <= 7) return; |
|
10 | + if (strlen($db['msisdn']) <= 7) { |
|
11 | + return; |
|
12 | + } |
|
11 | 13 | return $db['msisdn']; |
12 | 14 | } |
13 | 15 | }, $row); |
@@ -19,8 +19,9 @@ |
||
19 | 19 | $url .= "?s=$s&d=$d&r=$r"; |
20 | 20 | if ($img) { |
21 | 21 | $url = '<img src="' . $url . '"'; |
22 | - foreach ($atts as $key => $val) |
|
23 | - $url .= ' ' . $key . '="' . $val . '"'; |
|
22 | + foreach ($atts as $key => $val) { |
|
23 | + $url .= ' ' . $key . '="' . $val . '"'; |
|
24 | + } |
|
24 | 25 | $url .= ' />'; |
25 | 26 | } |
26 | 27 | return $url; |
@@ -47,13 +47,16 @@ discard block |
||
47 | 47 | */ |
48 | 48 | function __construct($db_details, $settings = array()) |
49 | 49 | { |
50 | - if (session_id() == '') |
|
51 | - session_start(); |
|
50 | + if (session_id() == '') { |
|
51 | + session_start(); |
|
52 | + } |
|
52 | 53 | |
53 | 54 | // we first manage the mysql connection |
54 | 55 | $this->link = @mysqli_connect($db_details['db_host'], $db_details['db_user'], $db_details['db_pass']); |
55 | 56 | |
56 | - if (!$this->link) die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); |
|
57 | + if (!$this->link) { |
|
58 | + die('Connect Error (' . mysqli_connect_errno() . ') ' . mysqli_connect_error()); |
|
59 | + } |
|
57 | 60 | |
58 | 61 | mysqli_select_db($this->link, $db_details['db_name']) or die(mysqli_error($this->link)); |
59 | 62 | |
@@ -63,8 +66,9 @@ discard block |
||
63 | 66 | $this->settings['comments_table'] = str_replace("`", "``", $this->settings['comments_table']); |
64 | 67 | |
65 | 68 | // auto install |
66 | - if ($this->settings['auto_install'] && !@mysqli_num_rows(mysqli_query($this->link, "SELECT `id` FROM `" . $this->settings['comments_table'] . "`"))) |
|
67 | - $this->install(); |
|
69 | + if ($this->settings['auto_install'] && !@mysqli_num_rows(mysqli_query($this->link, "SELECT `id` FROM `" . $this->settings['comments_table'] . "`"))) { |
|
70 | + $this->install(); |
|
71 | + } |
|
68 | 72 | |
69 | 73 | |
70 | 74 | // edit comment |
@@ -79,17 +83,21 @@ discard block |
||
79 | 83 | |
80 | 84 | |
81 | 85 | // delete comment |
82 | - if (isset($_POST['comm_del'])) |
|
83 | - if ($this->delComm($_POST['comm_del'])) |
|
86 | + if (isset($_POST['comm_del'])) { |
|
87 | + if ($this->delComm($_POST['comm_del'])) |
|
84 | 88 | $this->success = "Comment deleted !"; |
89 | + } |
|
85 | 90 | |
86 | 91 | // bann ip |
87 | - if (isset($_GET['comm_ban']) && $this->banIP($_GET['comm_ban'])) // we banned the ip |
|
92 | + if (isset($_GET['comm_ban']) && $this->banIP($_GET['comm_ban'])) { |
|
93 | + // we banned the ip |
|
88 | 94 | $this->success = "IP banned !"; |
95 | + } |
|
89 | 96 | |
90 | 97 | // UnBann ip |
91 | - if (isset($_GET['comm_unban']) && $this->unBanIP($_GET['comm_unban'])) |
|
92 | - $this->success = "IP UnBanned !"; |
|
98 | + if (isset($_GET['comm_unban']) && $this->unBanIP($_GET['comm_unban'])) { |
|
99 | + $this->success = "IP UnBanned !"; |
|
100 | + } |
|
93 | 101 | |
94 | 102 | return true; |
95 | 103 | } |
@@ -98,8 +106,9 @@ discard block |
||
98 | 106 | |
99 | 107 | function grabComment($pageid, $update_id = false) |
100 | 108 | { |
101 | - if (session_id() == '') |
|
102 | - session_start(); |
|
109 | + if (session_id() == '') { |
|
110 | + session_start(); |
|
111 | + } |
|
103 | 112 | |
104 | 113 | $_SESSION['comm_pageid'] = $pageid; |
105 | 114 | |
@@ -144,20 +153,22 @@ discard block |
||
144 | 153 | |
145 | 154 | |
146 | 155 | // we check in case the email is not valid |
147 | - if (!$this->settings['optional_email']) |
|
148 | - if (!$this->isValidMail($email)) { |
|
156 | + if (!$this->settings['optional_email']) { |
|
157 | + if (!$this->isValidMail($email)) { |
|
149 | 158 | $this->error = "Invalid email !"; |
159 | + } |
|
150 | 160 | return false; |
151 | 161 | } |
152 | 162 | |
153 | 163 | |
154 | 164 | // we check if it's an update or a new message |
155 | 165 | if ($update_id) { |
156 | - if ($this->settings['public']) |
|
157 | - $upd_fields = ",`name` = '" . mysqli_real_escape_string($this->link, $name) . "', |
|
166 | + if ($this->settings['public']) { |
|
167 | + $upd_fields = ",`name` = '" . mysqli_real_escape_string($this->link, $name) . "', |
|
158 | 168 | `email` = '" . mysqli_real_escape_string($this->link, $email) . "'"; |
159 | - else |
|
160 | - $upd_fields = ''; |
|
169 | + } else { |
|
170 | + $upd_fields = ''; |
|
171 | + } |
|
161 | 172 | |
162 | 173 | |
163 | 174 | if (mysqli_query($this->link, "UPDATE `" . $this->settings['comments_table'] . "` SET |
@@ -176,10 +187,11 @@ discard block |
||
176 | 187 | isset($_POST['comm_reply']) && |
177 | 188 | mysqli_num_rows(mysqli_query($this->link, "SELECT `id` FROM `" . $this->settings['comments_table'] . "` |
178 | 189 | WHERE `id`= '" . (int) $_POST['comm_reply'] . "' AND `parent` = '0'")) |
179 | - ) |
|
180 | - $reply = ",`parent` = '" . (int) $_POST['comm_reply'] . "'"; |
|
181 | - else |
|
182 | - $reply = ''; |
|
190 | + ) { |
|
191 | + $reply = ",`parent` = '" . (int) $_POST['comm_reply'] . "'"; |
|
192 | + } else { |
|
193 | + $reply = ''; |
|
194 | + } |
|
183 | 195 | |
184 | 196 | |
185 | 197 | |
@@ -216,8 +228,9 @@ discard block |
||
216 | 228 | function generateComments($pageid = 0, $perpage = 10) |
217 | 229 | { |
218 | 230 | |
219 | - if (session_id() == '') |
|
220 | - session_start(); |
|
231 | + if (session_id() == '') { |
|
232 | + session_start(); |
|
233 | + } |
|
221 | 234 | |
222 | 235 | $_SESSION['comm_pageid'] = $pageid; |
223 | 236 | |
@@ -230,8 +243,9 @@ discard block |
||
230 | 243 | // we generate the output of the comments |
231 | 244 | if ($comments) { |
232 | 245 | foreach ($comments as $comment) { |
233 | - if (!($name = $this->getUsername($comment->name))) |
|
234 | - $name = $comment->name; |
|
246 | + if (!($name = $this->getUsername($comment->name))) { |
|
247 | + $name = $comment->name; |
|
248 | + } |
|
235 | 249 | |
236 | 250 | // show reply link or form |
237 | 251 | if (isset($_GET['comm_reply']) && ($comment->id == $_GET['comm_reply'])) { |
@@ -295,18 +309,20 @@ discard block |
||
295 | 309 | $html = ""; |
296 | 310 | $comments = $this->getReplies($comm_id, $limit); |
297 | 311 | // we generate the output of the comments |
298 | - if ($comments) |
|
299 | - foreach ($comments as $comment) { |
|
312 | + if ($comments) { |
|
313 | + foreach ($comments as $comment) { |
|
300 | 314 | if (!($name = $this->getUsername($comment->name))) |
301 | 315 | $name = $comment->name; |
316 | + } |
|
302 | 317 | |
303 | 318 | // show normal username or with adminStyles |
304 | 319 | $style = ""; |
305 | 320 | if ($comment->isadmin) { |
306 | 321 | $show_name = "<span style='" . $this->settings['adminStyle']['username'] . "'>" . $this->html($name) . "</span>"; |
307 | 322 | $style = $this->settings['adminStyle']['box']; |
308 | - } else |
|
309 | - $show_name = $this->html($name); |
|
323 | + } else { |
|
324 | + $show_name = $this->html($name); |
|
325 | + } |
|
310 | 326 | |
311 | 327 | // show extra info only to admin |
312 | 328 | $show_extra = ""; |
@@ -325,19 +341,21 @@ discard block |
||
325 | 341 | <div class='media-body'>"; |
326 | 342 | |
327 | 343 | |
328 | - if (isset($_GET['comm_edit']) && ($_GET['comm_edit'] === $comment->id) && $this->hasRights($comment)) |
|
329 | - // we generate the form in edit mode with precompleted data |
|
344 | + if (isset($_GET['comm_edit']) && ($_GET['comm_edit'] === $comment->id) && $this->hasRights($comment)) { |
|
345 | + // we generate the form in edit mode with precompleted data |
|
330 | 346 | $html .= $this->generateForm('', 2, $comment); |
331 | - else |
|
332 | - $html .= "<h4 class='media-heading'> |
|
347 | + } else { |
|
348 | + $html .= "<h4 class='media-heading'> |
|
333 | 349 | $show_name $show_extra |
334 | 350 | <small class='muted'>" . $this->tsince($comment->time) . " replied </small> |
335 | 351 | " . $this->admin_options($comment) . " |
336 | 352 | </h4> |
337 | 353 | <p>" . nl2br($this->html($comment->message)) . "</p>"; |
354 | + } |
|
338 | 355 | |
339 | - if ($is_del) |
|
340 | - $html .= $this->gennerateConfirm('', 'comm_del', $comment->id); |
|
356 | + if ($is_del) { |
|
357 | + $html .= $this->gennerateConfirm('', 'comm_del', $comment->id); |
|
358 | + } |
|
341 | 359 | |
342 | 360 | $html .= "</div></div>"; |
343 | 361 | } |
@@ -348,19 +366,22 @@ discard block |
||
348 | 366 | function generateForm($location = '', $type = 0, $comment = false) |
349 | 367 | { |
350 | 368 | $this->setToken(); |
351 | - if ($location == '') |
|
352 | - $location = "?" . $this->queryString('', $this->ignore); |
|
369 | + if ($location == '') { |
|
370 | + $location = "?" . $this->queryString('', $this->ignore); |
|
371 | + } |
|
353 | 372 | |
354 | 373 | |
355 | - if (!$comment) |
|
356 | - $comment = (object) array("name" => "", "email" => "", "message" => ""); |
|
374 | + if (!$comment) { |
|
375 | + $comment = (object) array("name" => "", "email" => "", "message" => ""); |
|
376 | + } |
|
357 | 377 | |
358 | - if ($type == 1) |
|
359 | - $title = "<input type='hidden' name='comm_reply' value='" . (int) $_GET['comm_reply'] . "'>Post a reply"; |
|
360 | - else if ($type == 2) |
|
361 | - $title = "<input type='hidden' name='comm_edit' value='" . (int) $_GET['comm_edit'] . "'>Edit comment"; |
|
362 | - else |
|
363 | - $title = "Post a comment"; |
|
378 | + if ($type == 1) { |
|
379 | + $title = "<input type='hidden' name='comm_reply' value='" . (int) $_GET['comm_reply'] . "'>Post a reply"; |
|
380 | + } else if ($type == 2) { |
|
381 | + $title = "<input type='hidden' name='comm_edit' value='" . (int) $_GET['comm_edit'] . "'>Edit comment"; |
|
382 | + } else { |
|
383 | + $title = "Post a comment"; |
|
384 | + } |
|
364 | 385 | |
365 | 386 | $show_name_email = ''; |
366 | 387 | |
@@ -440,8 +461,9 @@ discard block |
||
440 | 461 | UNIQUE KEY `ip` (`ip`) |
441 | 462 | );"; |
442 | 463 | |
443 | - if (mysqli_query($this->link, $sql) && mysqli_query($this->link, $sql2)) |
|
444 | - return true; |
|
464 | + if (mysqli_query($this->link, $sql) && mysqli_query($this->link, $sql2)) { |
|
465 | + return true; |
|
466 | + } |
|
445 | 467 | |
446 | 468 | return false; |
447 | 469 | } |
@@ -457,8 +479,9 @@ discard block |
||
457 | 479 | |
458 | 480 | $sql = "SELECT * FROM `" . $this->settings['comments_table'] . "` WHERE `parent` = 0 "; |
459 | 481 | |
460 | - if ($pageid) |
|
461 | - $sql .= "AND `pageid` = '" . mysqli_real_escape_string($this->link, $pageid) . "'"; |
|
482 | + if ($pageid) { |
|
483 | + $sql .= "AND `pageid` = '" . mysqli_real_escape_string($this->link, $pageid) . "'"; |
|
484 | + } |
|
462 | 485 | |
463 | 486 | // some sorting options |
464 | 487 | $sql .= " " . $this->settings['sort'] . " "; // this is pasted as is |
@@ -469,18 +492,20 @@ discard block |
||
469 | 492 | |
470 | 493 | $total_results = mysqli_num_rows(mysqli_query($this->link, $sql)); |
471 | 494 | |
472 | - if ($page_number > ceil($total_results / $perpage)) |
|
473 | - $page_number = ceil($total_results / $perpage); |
|
495 | + if ($page_number > ceil($total_results / $perpage)) { |
|
496 | + $page_number = ceil($total_results / $perpage); |
|
497 | + } |
|
474 | 498 | |
475 | 499 | $start = ($page_number - 1) * $perpage; |
476 | 500 | |
477 | 501 | $sql .= "LIMIT $start, $perpage"; |
478 | 502 | |
479 | - if ($result = mysqli_query($this->link, $sql)) |
|
480 | - while ($row = mysqli_fetch_object($result)) |
|
503 | + if ($result = mysqli_query($this->link, $sql)) { |
|
504 | + while ($row = mysqli_fetch_object($result)) |
|
481 | 505 | $comments[] = $row; |
482 | - else |
|
483 | - return false; |
|
506 | + } else { |
|
507 | + return false; |
|
508 | + } |
|
484 | 509 | |
485 | 510 | return $comments; |
486 | 511 | } |
@@ -500,11 +525,12 @@ discard block |
||
500 | 525 | // limitation |
501 | 526 | $sql .= "LIMIT 0, $limit"; |
502 | 527 | |
503 | - if ($result = mysqli_query($this->link, $sql)) |
|
504 | - while ($row = mysqli_fetch_object($result)) |
|
528 | + if ($result = mysqli_query($this->link, $sql)) { |
|
529 | + while ($row = mysqli_fetch_object($result)) |
|
505 | 530 | $comments[] = $row; |
506 | - else |
|
507 | - return false; |
|
531 | + } else { |
|
532 | + return false; |
|
533 | + } |
|
508 | 534 | |
509 | 535 | return $comments; |
510 | 536 | } |
@@ -547,8 +573,9 @@ discard block |
||
547 | 573 | |
548 | 574 | $time = abs(time() - $time); // to get the time since that moment |
549 | 575 | |
550 | - if ($time == 0) |
|
551 | - return "Just now"; |
|
576 | + if ($time == 0) { |
|
577 | + return "Just now"; |
|
578 | + } |
|
552 | 579 | |
553 | 580 | $tokens = array( |
554 | 581 | 31536000 => 'year', |
@@ -561,7 +588,9 @@ discard block |
||
561 | 588 | ); |
562 | 589 | |
563 | 590 | foreach ($tokens as $unit => $text) { |
564 | - if ($time < $unit) continue; |
|
591 | + if ($time < $unit) { |
|
592 | + continue; |
|
593 | + } |
|
565 | 594 | $numberOfUnits = floor($time / $unit); |
566 | 595 | return $numberOfUnits . ' ' . $text . (($numberOfUnits > 1) ? 's' : '') . ' ' . $end_msg; |
567 | 596 | } |
@@ -570,13 +599,15 @@ discard block |
||
570 | 599 | function isValidMail($mail) |
571 | 600 | { |
572 | 601 | |
573 | - if (!filter_var($mail, FILTER_VALIDATE_EMAIL)) |
|
574 | - return FALSE; |
|
602 | + if (!filter_var($mail, FILTER_VALIDATE_EMAIL)) { |
|
603 | + return FALSE; |
|
604 | + } |
|
575 | 605 | |
576 | 606 | |
577 | 607 | list($username, $maildomain) = explode("@", $mail); |
578 | - if (checkdnsrr($maildomain, "MX")) |
|
579 | - return TRUE; |
|
608 | + if (checkdnsrr($maildomain, "MX")) { |
|
609 | + return TRUE; |
|
610 | + } |
|
580 | 611 | |
581 | 612 | return FALSE; |
582 | 613 | } |
@@ -633,8 +664,9 @@ discard block |
||
633 | 664 | */ |
634 | 665 | function setToken() |
635 | 666 | { |
636 | - if (session_id() == '') |
|
637 | - session_start(); |
|
667 | + if (session_id() == '') { |
|
668 | + session_start(); |
|
669 | + } |
|
638 | 670 | |
639 | 671 | $_SESSION['comm_token'] = md5(time() . rand()); |
640 | 672 | } |
@@ -652,8 +684,9 @@ discard block |
||
652 | 684 | foreach ($_GET as $k => $v) { |
653 | 685 | if ((is_array($ignore) && in_array($k, $ignore)) |
654 | 686 | || (is_string($ignore) && preg_match($ignore, $k)) |
655 | - ) |
|
656 | - continue; |
|
687 | + ) { |
|
688 | + continue; |
|
689 | + } |
|
657 | 690 | |
658 | 691 | if ($type == 'hidden') { |
659 | 692 | $result .= "<input type='hidden' name='" . urlencode($k) . "' value='" . urlencode($v) . "'>"; |
@@ -662,8 +695,9 @@ discard block |
||
662 | 695 | } |
663 | 696 | } |
664 | 697 | |
665 | - if (is_array($result)) |
|
666 | - return implode("&", $result); |
|
698 | + if (is_array($result)) { |
|
699 | + return implode("&", $result); |
|
700 | + } |
|
667 | 701 | |
668 | 702 | return $result; |
669 | 703 | } |
@@ -676,8 +710,9 @@ discard block |
||
676 | 710 | function gennerateConfirm($location = '', $info_name = 'comm_del', $info_value = 0, $submit = "I'm sure, Delete") |
677 | 711 | { |
678 | 712 | |
679 | - if ($location == '') |
|
680 | - $location = "?" . $this->queryString('', $this->ignore); |
|
713 | + if ($location == '') { |
|
714 | + $location = "?" . $this->queryString('', $this->ignore); |
|
715 | + } |
|
681 | 716 | |
682 | 717 | return "<form class='form-horizontal' action='$location' method='post'> |
683 | 718 | <div class='control-group'> |
@@ -696,11 +731,13 @@ discard block |
||
696 | 731 | */ |
697 | 732 | function hasRights($comment) |
698 | 733 | { |
699 | - if (session_id() == '') |
|
700 | - session_start(); |
|
734 | + if (session_id() == '') { |
|
735 | + session_start(); |
|
736 | + } |
|
701 | 737 | |
702 | - if ($this->settings['isAdmin'] || (isset($_SESSION['comm_last_id']) && $_SESSION['comm_last_id'] == $comment->id)) |
|
703 | - return true; |
|
738 | + if ($this->settings['isAdmin'] || (isset($_SESSION['comm_last_id']) && $_SESSION['comm_last_id'] == $comment->id)) { |
|
739 | + return true; |
|
740 | + } |
|
704 | 741 | return false; |
705 | 742 | } |
706 | 743 | /** |
@@ -711,13 +748,14 @@ discard block |
||
711 | 748 | function admin_options($comment) |
712 | 749 | { |
713 | 750 | // if is admin or the person who posted the message |
714 | - if ($this->hasRights($comment)) |
|
715 | - return "<a href='?" . $this->queryString('', $this->ignore) . "&comm_edit=$comment->id#$comment->id'>Edit</a> |
|
751 | + if ($this->hasRights($comment)) { |
|
752 | + return "<a href='?" . $this->queryString('', $this->ignore) . "&comm_edit=$comment->id#$comment->id'>Edit</a> |
|
716 | 753 | | <a href='?" . $this->queryString('', $this->ignore) . "&comm_del=$comment->id#$comment->id'>Delete</a>" . |
717 | 754 | ($this->settings['isAdmin'] ? //if is admin |
718 | 755 | " | <a href='?" . $this->queryString('', $this->ignore) . "&comm_" . |
719 | 756 | ($this->isBanned($comment->ip) ? "un" : "") . "ban=" . urlencode($comment->ip) . "'>" . |
720 | 757 | ($this->isBanned($comment->ip) ? "Un" : "") . "Ban</a>" : ""); |
758 | + } |
|
721 | 759 | } |
722 | 760 | |
723 | 761 | |
@@ -734,8 +772,9 @@ discard block |
||
734 | 772 | |
735 | 773 | $sql = "SELECT `id` FROM `" . $this->settings['comments_table'] . "` WHERE `parent` = 0 "; |
736 | 774 | |
737 | - if ($pageid) |
|
738 | - $sql .= " AND `pageid`='" . (int) $pageid . "'"; |
|
775 | + if ($pageid) { |
|
776 | + $sql .= " AND `pageid`='" . (int) $pageid . "'"; |
|
777 | + } |
|
739 | 778 | |
740 | 779 | |
741 | 780 | $total = mysqli_num_rows(mysqli_query($this->link, $sql)); |
@@ -748,20 +787,25 @@ discard block |
||
748 | 787 | |
749 | 788 | $html = "<div class='pagination'><ul>"; |
750 | 789 | |
751 | - if ($page > 4) |
|
752 | - $html .= "<li><a href='?$query'>First</a></li>"; |
|
790 | + if ($page > 4) { |
|
791 | + $html .= "<li><a href='?$query'>First</a></li>"; |
|
792 | + } |
|
753 | 793 | |
754 | - if ($page > 1) |
|
755 | - $html .= "<li><a href='?comm_page=" . ($page - 1) . "$query'>Prev</a> </li>"; |
|
794 | + if ($page > 1) { |
|
795 | + $html .= "<li><a href='?comm_page=" . ($page - 1) . "$query'>Prev</a> </li>"; |
|
796 | + } |
|
756 | 797 | |
757 | - for ($i = max(1, $page - 3); $i <= min($page + 3, $total_pages); $i++) |
|
758 | - $html .= ($i == $page ? "<li class='active'><a>" . $i . "</a></li>" : " <li><a href='?comm_page=$i$query'>$i</a></li> "); |
|
798 | + for ($i = max(1, $page - 3); $i <= min($page + 3, $total_pages); $i++) { |
|
799 | + $html .= ($i == $page ? "<li class='active'><a>" . $i . "</a></li>" : " <li><a href='?comm_page=$i$query'>$i</a></li> "); |
|
800 | + } |
|
759 | 801 | |
760 | - if ($page < $total_pages) |
|
761 | - $html .= "<li><a href='?comm_page=" . ($page + 1) . "$query'>Next</a></li>"; |
|
802 | + if ($page < $total_pages) { |
|
803 | + $html .= "<li><a href='?comm_page=" . ($page + 1) . "$query'>Next</a></li>"; |
|
804 | + } |
|
762 | 805 | |
763 | - if ($page < $total_pages - 3) |
|
764 | - $html .= "<li><a href='?comm_page=$total_pages$query'> Last </a></li>"; |
|
806 | + if ($page < $total_pages - 3) { |
|
807 | + $html .= "<li><a href='?comm_page=$total_pages$query'> Last </a></li>"; |
|
808 | + } |
|
765 | 809 | |
766 | 810 | $html .= "</ul></div>"; |
767 | 811 | |
@@ -791,10 +835,11 @@ discard block |
||
791 | 835 | */ |
792 | 836 | function banIP($ip) |
793 | 837 | { |
794 | - if ($this->settings['isAdmin']) |
|
795 | - if (mysqli_query($this->link, "INSERT INTO `" . $this->settings['banned_table'] . "` |
|
838 | + if ($this->settings['isAdmin']) { |
|
839 | + if (mysqli_query($this->link, "INSERT INTO `" . $this->settings['banned_table'] . "` |
|
796 | 840 | SET `ip` = '" . mysqli_real_escape_string($this->link, $ip) . "'")) |
797 | 841 | return true; |
842 | + } |
|
798 | 843 | return false; |
799 | 844 | } |
800 | 845 | |
@@ -820,8 +865,9 @@ discard block |
||
820 | 865 | function isBanned($ip) |
821 | 866 | { |
822 | 867 | // no need to check the same ip 2 times in a row |
823 | - if (count($this->checked_ips) && in_array($ip, array_keys($this->checked_ips))) |
|
824 | - return $this->checked_ips[$ip]; |
|
868 | + if (count($this->checked_ips) && in_array($ip, array_keys($this->checked_ips))) { |
|
869 | + return $this->checked_ips[$ip]; |
|
870 | + } |
|
825 | 871 | |
826 | 872 | $this->checked_ips[$ip] = $ip; |
827 | 873 |
@@ -282,8 +282,7 @@ |
||
282 | 282 | ); |
283 | 283 | if (array_key_exists($name, $color_names)) { |
284 | 284 | return $color_names[$name]; |
285 | - } |
|
286 | - else { |
|
285 | + } else { |
|
287 | 286 | //error |
288 | 287 | } |
289 | 288 | } |
@@ -449,52 +449,43 @@ discard block |
||
449 | 449 | { |
450 | 450 | $r[] = $indent . (substr($lines[$ii], 0, 1) == "*" ? " " : "") . $lines[$ii]; |
451 | 451 | } |
452 | - } |
|
453 | - elseif ($class === "CssAtCharsetToken") |
|
452 | + } elseif ($class === "CssAtCharsetToken") |
|
454 | 453 | { |
455 | 454 | $r[] = $indent . "@charset " . $token->Charset . ";"; |
456 | - } |
|
457 | - elseif ($class === "CssAtFontFaceStartToken") |
|
455 | + } elseif ($class === "CssAtFontFaceStartToken") |
|
458 | 456 | { |
459 | 457 | $r[] = $indent . "@font-face"; |
460 | 458 | $r[] = $this->indent . $indent . "{"; |
461 | 459 | $level++; |
462 | - } |
|
463 | - elseif ($class === "CssAtImportToken") |
|
460 | + } elseif ($class === "CssAtImportToken") |
|
464 | 461 | { |
465 | 462 | $r[] = $indent . "@import " . $token->Import . " " . implode(", ", $token->MediaTypes) . ";"; |
466 | - } |
|
467 | - elseif ($class === "CssAtKeyframesStartToken") |
|
463 | + } elseif ($class === "CssAtKeyframesStartToken") |
|
468 | 464 | { |
469 | 465 | $r[] = $indent . "@keyframes \"" . $token->Name . "\""; |
470 | 466 | $r[] = $this->indent . $indent . "{"; |
471 | 467 | $level++; |
472 | - } |
|
473 | - elseif ($class === "CssAtMediaStartToken") |
|
468 | + } elseif ($class === "CssAtMediaStartToken") |
|
474 | 469 | { |
475 | 470 | $r[] = $indent . "@media " . implode(", ", $token->MediaTypes); |
476 | 471 | $r[] = $this->indent . $indent . "{"; |
477 | 472 | $level++; |
478 | - } |
|
479 | - elseif ($class === "CssAtPageStartToken") |
|
473 | + } elseif ($class === "CssAtPageStartToken") |
|
480 | 474 | { |
481 | 475 | $r[] = $indent . "@page"; |
482 | 476 | $r[] = $this->indent . $indent . "{"; |
483 | 477 | $level++; |
484 | - } |
|
485 | - elseif ($class === "CssAtVariablesStartToken") |
|
478 | + } elseif ($class === "CssAtVariablesStartToken") |
|
486 | 479 | { |
487 | 480 | $r[] = $indent . "@variables " . implode(", ", $token->MediaTypes); |
488 | 481 | $r[] = $this->indent . $indent . "{"; |
489 | 482 | $level++; |
490 | - } |
|
491 | - elseif ($class === "CssRulesetStartToken" || $class === "CssAtKeyframesRulesetStartToken") |
|
483 | + } elseif ($class === "CssRulesetStartToken" || $class === "CssAtKeyframesRulesetStartToken") |
|
492 | 484 | { |
493 | 485 | $r[] = $indent . implode(", ", $token->Selectors); |
494 | 486 | $r[] = $this->indent . $indent . "{"; |
495 | 487 | $level++; |
496 | - } |
|
497 | - elseif ($class == "CssAtFontFaceDeclarationToken" |
|
488 | + } elseif ($class == "CssAtFontFaceDeclarationToken" |
|
498 | 489 | || $class === "CssAtKeyframesRulesetDeclarationToken" |
499 | 490 | || $class === "CssAtPageDeclarationToken" |
500 | 491 | || $class == "CssAtVariablesDeclarationToken" |
@@ -507,8 +498,7 @@ discard block |
||
507 | 498 | $declaration = str_pad($declaration, $this->padding, " ", STR_PAD_RIGHT); |
508 | 499 | } |
509 | 500 | $r[] = $declaration . $token->Value . ($token->IsImportant ? " !important" : "") . ";"; |
510 | - } |
|
511 | - elseif ($class === "CssAtFontFaceEndToken" |
|
501 | + } elseif ($class === "CssAtFontFaceEndToken" |
|
512 | 502 | || $class === "CssAtMediaEndToken" |
513 | 503 | || $class === "CssAtKeyframesEndToken" |
514 | 504 | || $class === "CssAtKeyframesRulesetEndToken" |
@@ -721,8 +711,7 @@ discard block |
||
721 | 711 | if (!($plugin = $this->minifier->getPlugin("CssVariablesMinifierPlugin"))) |
722 | 712 | { |
723 | 713 | CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": The plugin <code>CssVariablesMinifierPlugin</code> was not found but is required for <code>" . __CLASS__ . "</code>")); |
724 | - } |
|
725 | - else |
|
714 | + } else |
|
726 | 715 | { |
727 | 716 | $plugin->setVariables($variables); |
728 | 717 | } |
@@ -797,8 +786,7 @@ discard block |
||
797 | 786 | { |
798 | 787 | $this->parser->popState(); |
799 | 788 | $this->parser->unsetExclusive(); |
800 | - } |
|
801 | - else |
|
789 | + } else |
|
802 | 790 | { |
803 | 791 | return false; |
804 | 792 | } |
@@ -898,8 +886,7 @@ discard block |
||
898 | 886 | $this->parser->popState(); |
899 | 887 | $this->parser->unsetExclusive(); |
900 | 888 | $this->delimiterChar = null; |
901 | - } |
|
902 | - else |
|
889 | + } else |
|
903 | 890 | { |
904 | 891 | return false; |
905 | 892 | } |
@@ -974,8 +961,7 @@ discard block |
||
974 | 961 | if ($ii == $ll) |
975 | 962 | { |
976 | 963 | $declarations[$ii]->IsLast = true; |
977 | - } |
|
978 | - else |
|
964 | + } else |
|
979 | 965 | { |
980 | 966 | $declarations[$ii]->IsLast = false; |
981 | 967 | } |
@@ -1133,8 +1119,7 @@ discard block |
||
1133 | 1119 | { |
1134 | 1120 | $value = trim(substr($value, 0, -10)); |
1135 | 1121 | $isImportant = true; |
1136 | - } |
|
1137 | - else |
|
1122 | + } else |
|
1138 | 1123 | { |
1139 | 1124 | $isImportant = false; |
1140 | 1125 | } |
@@ -1156,8 +1141,7 @@ discard block |
||
1156 | 1141 | $this->parser->appendToken(new CssRulesetEndToken()); |
1157 | 1142 | $this->buffer = ""; |
1158 | 1143 | $this->selectors = array(); |
1159 | - } |
|
1160 | - else |
|
1144 | + } else |
|
1161 | 1145 | { |
1162 | 1146 | return false; |
1163 | 1147 | } |
@@ -1462,8 +1446,7 @@ discard block |
||
1462 | 1446 | if (class_exists($class)) |
1463 | 1447 | { |
1464 | 1448 | $this->plugins[] = new $class($this, $config); |
1465 | - } |
|
1466 | - else |
|
1449 | + } else |
|
1467 | 1450 | { |
1468 | 1451 | CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": The plugin <code>" . $name . "</code> with the class name <code>" . $class . "</code> was not found")); |
1469 | 1452 | } |
@@ -1825,46 +1808,37 @@ discard block |
||
1825 | 1808 | { |
1826 | 1809 | $r[] = $indent . (substr($lines[$ii], 0, 1) == "*" ? " " : "") . $lines[$ii]; |
1827 | 1810 | } |
1828 | - } |
|
1829 | - elseif ($class === "CssAtCharsetToken") |
|
1811 | + } elseif ($class === "CssAtCharsetToken") |
|
1830 | 1812 | { |
1831 | 1813 | $r[] = $indent . "@charset " . $token->Charset . ";"; |
1832 | - } |
|
1833 | - elseif ($class === "CssAtFontFaceStartToken") |
|
1814 | + } elseif ($class === "CssAtFontFaceStartToken") |
|
1834 | 1815 | { |
1835 | 1816 | $r[] = $indent . "@font-face {"; |
1836 | 1817 | $level++; |
1837 | - } |
|
1838 | - elseif ($class === "CssAtImportToken") |
|
1818 | + } elseif ($class === "CssAtImportToken") |
|
1839 | 1819 | { |
1840 | 1820 | $r[] = $indent . "@import " . $token->Import . " " . implode(", ", $token->MediaTypes) . ";"; |
1841 | - } |
|
1842 | - elseif ($class === "CssAtKeyframesStartToken") |
|
1821 | + } elseif ($class === "CssAtKeyframesStartToken") |
|
1843 | 1822 | { |
1844 | 1823 | $r[] = $indent . "@keyframes \"" . $token->Name . "\" {"; |
1845 | 1824 | $level++; |
1846 | - } |
|
1847 | - elseif ($class === "CssAtMediaStartToken") |
|
1825 | + } elseif ($class === "CssAtMediaStartToken") |
|
1848 | 1826 | { |
1849 | 1827 | $r[] = $indent . "@media " . implode(", ", $token->MediaTypes) . " {"; |
1850 | 1828 | $level++; |
1851 | - } |
|
1852 | - elseif ($class === "CssAtPageStartToken") |
|
1829 | + } elseif ($class === "CssAtPageStartToken") |
|
1853 | 1830 | { |
1854 | 1831 | $r[] = $indent . "@page {"; |
1855 | 1832 | $level++; |
1856 | - } |
|
1857 | - elseif ($class === "CssAtVariablesStartToken") |
|
1833 | + } elseif ($class === "CssAtVariablesStartToken") |
|
1858 | 1834 | { |
1859 | 1835 | $r[] = $indent . "@variables " . implode(", ", $token->MediaTypes) . " {"; |
1860 | 1836 | $level++; |
1861 | - } |
|
1862 | - elseif ($class === "CssRulesetStartToken" || $class === "CssAtKeyframesRulesetStartToken") |
|
1837 | + } elseif ($class === "CssRulesetStartToken" || $class === "CssAtKeyframesRulesetStartToken") |
|
1863 | 1838 | { |
1864 | 1839 | $r[] = $indent . implode(", ", $token->Selectors) . " {"; |
1865 | 1840 | $level++; |
1866 | - } |
|
1867 | - elseif ($class == "CssAtFontFaceDeclarationToken" |
|
1841 | + } elseif ($class == "CssAtFontFaceDeclarationToken" |
|
1868 | 1842 | || $class === "CssAtKeyframesRulesetDeclarationToken" |
1869 | 1843 | || $class === "CssAtPageDeclarationToken" |
1870 | 1844 | || $class == "CssAtVariablesDeclarationToken" |
@@ -1877,8 +1851,7 @@ discard block |
||
1877 | 1851 | $declaration = str_pad($declaration, $this->padding, " ", STR_PAD_RIGHT); |
1878 | 1852 | } |
1879 | 1853 | $r[] = $declaration . $token->Value . ($token->IsImportant ? " !important" : "") . ";"; |
1880 | - } |
|
1881 | - elseif ($class === "CssAtFontFaceEndToken" |
|
1854 | + } elseif ($class === "CssAtFontFaceEndToken" |
|
1882 | 1855 | || $class === "CssAtMediaEndToken" |
1883 | 1856 | || $class === "CssAtKeyframesEndToken" |
1884 | 1857 | || $class === "CssAtKeyframesRulesetEndToken" |
@@ -1992,8 +1965,7 @@ discard block |
||
1992 | 1965 | if (class_exists($class)) |
1993 | 1966 | { |
1994 | 1967 | $this->filters[] = new $class($this, $config); |
1995 | - } |
|
1996 | - else |
|
1968 | + } else |
|
1997 | 1969 | { |
1998 | 1970 | CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": The filter <code>" . $name . "</code> with the class name <code>" . $class . "</code> was not found")); |
1999 | 1971 | } |
@@ -2009,8 +1981,7 @@ discard block |
||
2009 | 1981 | if (class_exists($class)) |
2010 | 1982 | { |
2011 | 1983 | $this->plugins[] = new $class($this, $config); |
2012 | - } |
|
2013 | - else |
|
1984 | + } else |
|
2014 | 1985 | { |
2015 | 1986 | CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": The plugin <code>" . $name . "</code> with the class name <code>" . $class . "</code> was not found")); |
2016 | 1987 | } |
@@ -2362,8 +2333,7 @@ discard block |
||
2362 | 2333 | { |
2363 | 2334 | CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Import file <code>" . $import. "</code> was already imported.", (string) $tokens[$i])); |
2364 | 2335 | $tokens[$i] = null; |
2365 | - } |
|
2366 | - else |
|
2336 | + } else |
|
2367 | 2337 | { |
2368 | 2338 | $this->imported[] = $import; |
2369 | 2339 | $parser = new CssParser(file_get_contents($import)); |
@@ -2595,8 +2565,7 @@ discard block |
||
2595 | 2565 | $this->leftBraces = $this->rightBraces = 0; |
2596 | 2566 | $this->parser->popState(); |
2597 | 2567 | return $index - 1; |
2598 | - } |
|
2599 | - else |
|
2568 | + } else |
|
2600 | 2569 | { |
2601 | 2570 | return false; |
2602 | 2571 | } |
@@ -3214,8 +3183,7 @@ discard block |
||
3214 | 3183 | { |
3215 | 3184 | $result = array($result); |
3216 | 3185 | } |
3217 | - } |
|
3218 | - else |
|
3186 | + } else |
|
3219 | 3187 | { |
3220 | 3188 | $tValue = $tokens[$i]->Value; |
3221 | 3189 | $tMediaTypes = $tokens[$i]->MediaTypes; |
@@ -3297,8 +3265,7 @@ discard block |
||
3297 | 3265 | new CssRulesetDeclarationToken("word-wrap", "break-word", $token->MediaTypes) |
3298 | 3266 | ); |
3299 | 3267 | return $r; |
3300 | - } |
|
3301 | - else |
|
3268 | + } else |
|
3302 | 3269 | { |
3303 | 3270 | return array(); |
3304 | 3271 | } |
@@ -3359,8 +3326,7 @@ discard block |
||
3359 | 3326 | if (isset($this->configuration["RemoveSource"]) && $this->configuration["RemoveSource"] === true) |
3360 | 3327 | { |
3361 | 3328 | array_splice($tokens, $i, $ii - $i + 1, $add); |
3362 | - } |
|
3363 | - else |
|
3329 | + } else |
|
3364 | 3330 | { |
3365 | 3331 | array_splice($tokens, $ii + 1, 0, $add); |
3366 | 3332 | } |
@@ -3450,14 +3416,12 @@ discard block |
||
3450 | 3416 | $red = $lightness * 255; |
3451 | 3417 | $green = $lightness * 255; |
3452 | 3418 | $blue = $lightness * 255; |
3453 | - } |
|
3454 | - else |
|
3419 | + } else |
|
3455 | 3420 | { |
3456 | 3421 | if ($lightness < 0.5 ) |
3457 | 3422 | { |
3458 | 3423 | $v2 = $lightness * (1 + $saturation); |
3459 | - } |
|
3460 | - else |
|
3424 | + } else |
|
3461 | 3425 | { |
3462 | 3426 | $v2 = ($lightness + $saturation) - ($saturation * $lightness); |
3463 | 3427 | } |
@@ -3884,15 +3848,13 @@ discard block |
||
3884 | 3848 | $this->parser->pushState("T_COMMENT"); |
3885 | 3849 | $this->parser->setExclusive(__CLASS__); |
3886 | 3850 | $this->restoreBuffer = substr($this->parser->getAndClearBuffer(), 0, -2); |
3887 | - } |
|
3888 | - elseif ($char === "/" && $previousChar === "*" && $state === "T_COMMENT") |
|
3851 | + } elseif ($char === "/" && $previousChar === "*" && $state === "T_COMMENT") |
|
3889 | 3852 | { |
3890 | 3853 | $this->parser->popState(); |
3891 | 3854 | $this->parser->unsetExclusive(); |
3892 | 3855 | $this->parser->appendToken(new CssCommentToken("/*" . $this->parser->getAndClearBuffer())); |
3893 | 3856 | $this->parser->setBuffer($this->restoreBuffer); |
3894 | - } |
|
3895 | - else |
|
3857 | + } else |
|
3896 | 3858 | { |
3897 | 3859 | return false; |
3898 | 3860 | } |
@@ -4020,8 +3982,7 @@ discard block |
||
4020 | 3982 | { |
4021 | 3983 | $value = trim(substr($value, 0, -10)); |
4022 | 3984 | $isImportant = true; |
4023 | - } |
|
4024 | - else |
|
3985 | + } else |
|
4025 | 3986 | { |
4026 | 3987 | $isImportant = false; |
4027 | 3988 | } |
@@ -4035,8 +3996,7 @@ discard block |
||
4035 | 3996 | $this->parser->popState(); |
4036 | 3997 | $this->parser->clearBuffer(); |
4037 | 3998 | $this->parser->appendToken(new CssAtVariablesEndToken()); |
4038 | - } |
|
4039 | - else |
|
3999 | + } else |
|
4040 | 4000 | { |
4041 | 4001 | return false; |
4042 | 4002 | } |
@@ -4211,8 +4171,7 @@ discard block |
||
4211 | 4171 | { |
4212 | 4172 | $value = trim(substr($value, 0, -10)); |
4213 | 4173 | $isImportant = true; |
4214 | - } |
|
4215 | - else |
|
4174 | + } else |
|
4216 | 4175 | { |
4217 | 4176 | $isImportant = false; |
4218 | 4177 | } |
@@ -4232,8 +4191,7 @@ discard block |
||
4232 | 4191 | $this->parser->popState(); |
4233 | 4192 | $this->parser->clearBuffer(); |
4234 | 4193 | $this->parser->appendToken(new CssAtPageEndToken()); |
4235 | - } |
|
4236 | - else |
|
4194 | + } else |
|
4237 | 4195 | { |
4238 | 4196 | return false; |
4239 | 4197 | } |
@@ -4353,22 +4311,19 @@ discard block |
||
4353 | 4311 | $this->parser->pushState("T_AT_MEDIA::PREPARE"); |
4354 | 4312 | $this->parser->clearBuffer(); |
4355 | 4313 | return $index + 6; |
4356 | - } |
|
4357 | - elseif ($char === "{" && $state === "T_AT_MEDIA::PREPARE") |
|
4314 | + } elseif ($char === "{" && $state === "T_AT_MEDIA::PREPARE") |
|
4358 | 4315 | { |
4359 | 4316 | $mediaTypes = array_filter(array_map("trim", explode(",", $this->parser->getAndClearBuffer("{")))); |
4360 | 4317 | $this->parser->setMediaTypes($mediaTypes); |
4361 | 4318 | $this->parser->setState("T_AT_MEDIA"); |
4362 | 4319 | $this->parser->appendToken(new CssAtMediaStartToken($mediaTypes)); |
4363 | - } |
|
4364 | - elseif ($char === "}" && $state === "T_AT_MEDIA") |
|
4320 | + } elseif ($char === "}" && $state === "T_AT_MEDIA") |
|
4365 | 4321 | { |
4366 | 4322 | $this->parser->appendToken(new CssAtMediaEndToken()); |
4367 | 4323 | $this->parser->clearBuffer(); |
4368 | 4324 | $this->parser->unsetMediaTypes(); |
4369 | 4325 | $this->parser->popState(); |
4370 | - } |
|
4371 | - else |
|
4326 | + } else |
|
4372 | 4327 | { |
4373 | 4328 | return false; |
4374 | 4329 | } |
@@ -4631,8 +4586,7 @@ discard block |
||
4631 | 4586 | { |
4632 | 4587 | $value = trim(substr($value, 0, -10)); |
4633 | 4588 | $isImportant = true; |
4634 | - } |
|
4635 | - else |
|
4589 | + } else |
|
4636 | 4590 | { |
4637 | 4591 | $isImportant = false; |
4638 | 4592 | } |
@@ -4660,8 +4614,7 @@ discard block |
||
4660 | 4614 | $this->parser->clearBuffer(); |
4661 | 4615 | $this->parser->popState(); |
4662 | 4616 | $this->parser->appendToken(new CssAtKeyframesEndToken()); |
4663 | - } |
|
4664 | - else |
|
4617 | + } else |
|
4665 | 4618 | { |
4666 | 4619 | return false; |
4667 | 4620 | } |
@@ -4778,8 +4731,7 @@ discard block |
||
4778 | 4731 | $this->parser->pushState("T_AT_IMPORT"); |
4779 | 4732 | $this->parser->clearBuffer(); |
4780 | 4733 | return $index + 7; |
4781 | - } |
|
4782 | - elseif (($char === ";" || $char === "\n") && $state === "T_AT_IMPORT") |
|
4734 | + } elseif (($char === ";" || $char === "\n") && $state === "T_AT_IMPORT") |
|
4783 | 4735 | { |
4784 | 4736 | $this->buffer = $this->parser->getAndClearBuffer(";"); |
4785 | 4737 | $pos = false; |
@@ -4800,14 +4752,12 @@ discard block |
||
4800 | 4752 | if ($pos) |
4801 | 4753 | { |
4802 | 4754 | $this->parser->appendToken(new CssAtImportToken($import, $mediaTypes)); |
4803 | - } |
|
4804 | - else |
|
4755 | + } else |
|
4805 | 4756 | { |
4806 | 4757 | CssMin::triggerError(new CssError(__FILE__, __LINE__, __METHOD__ . ": Invalid @import at-rule syntax", $this->parser->buffer)); |
4807 | 4758 | } |
4808 | 4759 | $this->parser->popState(); |
4809 | - } |
|
4810 | - else |
|
4760 | + } else |
|
4811 | 4761 | { |
4812 | 4762 | return false; |
4813 | 4763 | } |
@@ -4919,8 +4869,7 @@ discard block |
||
4919 | 4869 | { |
4920 | 4870 | $value = trim(substr($value, 0, -10)); |
4921 | 4871 | $isImportant = true; |
4922 | - } |
|
4923 | - else |
|
4872 | + } else |
|
4924 | 4873 | { |
4925 | 4874 | $isImportant = false; |
4926 | 4875 | } |
@@ -4940,8 +4889,7 @@ discard block |
||
4940 | 4889 | $this->parser->appendToken(new CssAtFontFaceEndToken()); |
4941 | 4890 | $this->parser->clearBuffer(); |
4942 | 4891 | $this->parser->popState(); |
4943 | - } |
|
4944 | - else |
|
4892 | + } else |
|
4945 | 4893 | { |
4946 | 4894 | return false; |
4947 | 4895 | } |
@@ -5065,14 +5013,12 @@ discard block |
||
5065 | 5013 | $this->parser->pushState("T_AT_CHARSET"); |
5066 | 5014 | $this->parser->clearBuffer(); |
5067 | 5015 | return $index + 8; |
5068 | - } |
|
5069 | - elseif (($char === ";" || $char === "\n") && $state === "T_AT_CHARSET") |
|
5016 | + } elseif (($char === ";" || $char === "\n") && $state === "T_AT_CHARSET") |
|
5070 | 5017 | { |
5071 | 5018 | $charset = $this->parser->getAndClearBuffer(";"); |
5072 | 5019 | $this->parser->popState(); |
5073 | 5020 | $this->parser->appendToken(new CssAtCharsetToken($charset)); |
5074 | - } |
|
5075 | - else |
|
5021 | + } else |
|
5076 | 5022 | { |
5077 | 5023 | return false; |
5078 | 5024 | } |
@@ -300,7 +300,7 @@ |
||
300 | 300 | { |
301 | 301 | if ($isNameProvided) { |
302 | 302 | $this->name = filter_var($isNameProvided, FILTER_SANITIZE_STRING); |
303 | - }else{ |
|
303 | + } else{ |
|
304 | 304 | $this->name = uniqid('', true) . '_' . str_shuffle(implode(range('e', 'q'))); |
305 | 305 | } |
306 | 306 |
@@ -15,7 +15,9 @@ discard block |
||
15 | 15 | */ |
16 | 16 | function cors() |
17 | 17 | { |
18 | - if (!headers_sent()) return; |
|
18 | + if (!headers_sent()) { |
|
19 | + return; |
|
20 | + } |
|
19 | 21 | |
20 | 22 | // Allow from any origin |
21 | 23 | if (isset($_SERVER['HTTP_ORIGIN'])) { |
@@ -151,7 +153,9 @@ discard block |
||
151 | 153 | if (!file_exists(dirname($file))) { |
152 | 154 | mkdir(dirname($file)); |
153 | 155 | } |
154 | - if (file_exists($file)) delete($file); |
|
156 | + if (file_exists($file)) { |
|
157 | + delete($file); |
|
158 | + } |
|
155 | 159 | file_put_contents($file, $content, ($append ? FILE_APPEND : 0)); |
156 | 160 | } |
157 | 161 |
@@ -19,9 +19,13 @@ |
||
19 | 19 | $thePost = $_POST[$name]; |
20 | 20 | if ($flag != POST_DEFAULT_FLAG) { |
21 | 21 | if ($flag == POST_NOT_NULL) { |
22 | - if ($thePost != null) return $thePost; |
|
22 | + if ($thePost != null) { |
|
23 | + return $thePost; |
|
24 | + } |
|
23 | 25 | } else if ($flag == POST_NOT_EMPTY) { |
24 | - if (!empty($thePost)) return $thePost; |
|
26 | + if (!empty($thePost)) { |
|
27 | + return $thePost; |
|
28 | + } |
|
25 | 29 | } |
26 | 30 | } else { |
27 | 31 | return $thePost; |