@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) { |
| 60 | 60 | $csrfOkay = false; |
| 61 | 61 | } |
| 62 | - if (0 === (int) $userId || !$csrfOkay) { |
|
| 62 | + if (0 === (int)$userId || !$csrfOkay) { |
|
| 63 | 63 | $message .= sprintf('<p class="alert alert-danger">%s</p>', $PMF_LANG['ad_user_error_noId']); |
| 64 | 64 | } else { |
| 65 | 65 | $user = new PMF_User($faqConfig); |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | $csrfOkay = false; |
| 181 | 181 | } |
| 182 | 182 | $userAction = $defaultUserAction; |
| 183 | - if (0 === (int) $userId || !$csrfOkay) { |
|
| 183 | + if (0 === (int)$userId || !$csrfOkay) { |
|
| 184 | 184 | $message .= sprintf('<p class="alert alert-danger">%s</p>', $PMF_LANG['ad_user_error_noId']); |
| 185 | 185 | } else { |
| 186 | 186 | if (!$user->getUserById($userId, true)) { |
@@ -669,8 +669,8 @@ discard block |
||
| 669 | 669 | $numUsers = count($allUsers); |
| 670 | 670 | $page = PMF_Filter::filterInput(INPUT_GET, 'page', FILTER_VALIDATE_INT, 0); |
| 671 | 671 | $perPage = 10; |
| 672 | - $numPages = ceil($numUsers / $perPage); |
|
| 673 | - $lastPage = $page * $perPage; |
|
| 672 | + $numPages = ceil($numUsers/$perPage); |
|
| 673 | + $lastPage = $page*$perPage; |
|
| 674 | 674 | $firstPage = $lastPage - $perPage; |
| 675 | 675 | |
| 676 | 676 | $baseUrl = sprintf( |
@@ -660,8 +660,8 @@ discard block |
||
| 660 | 660 | |
| 661 | 661 | $message = array( |
| 662 | 662 | 'success' => trim($PMF_LANG['successMessage']). |
| 663 | - ' '. |
|
| 664 | - trim($PMF_LANG['msgRegThankYou']), |
|
| 663 | + ' '. |
|
| 664 | + trim($PMF_LANG['msgRegThankYou']), |
|
| 665 | 665 | ); |
| 666 | 666 | } |
| 667 | 667 | } else { |
@@ -763,7 +763,7 @@ discard block |
||
| 763 | 763 | $attached = PMF_Filter::filterInput(INPUT_POST, 'message', FILTER_SANITIZE_STRIPPED); |
| 764 | 764 | $mailto = PMF_Filter::filterInputArray(INPUT_POST, |
| 765 | 765 | array('mailto' => array('filter' => FILTER_VALIDATE_EMAIL, |
| 766 | - 'flags' => FILTER_REQUIRE_ARRAY | FILTER_NULL_ON_FAILURE, |
|
| 766 | + 'flags' => FILTER_REQUIRE_ARRAY | FILTER_NULL_ON_FAILURE, |
|
| 767 | 767 | ), |
| 768 | 768 | ) |
| 769 | 769 | ); |
@@ -686,7 +686,7 @@ discard block |
||
| 686 | 686 | $votingData = array( |
| 687 | 687 | 'record_id' => $recordId, |
| 688 | 688 | 'vote' => $vote, |
| 689 | - 'user_ip' => $userIp, ); |
|
| 689 | + 'user_ip' => $userIp,); |
|
| 690 | 690 | |
| 691 | 691 | if (!$faq->getNumberOfVotings($recordId)) { |
| 692 | 692 | $faq->addVoting($votingData); |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | |
| 825 | 825 | $userData = array( |
| 826 | 826 | 'display_name' => $name, |
| 827 | - 'email' => $email, ); |
|
| 827 | + 'email' => $email,); |
|
| 828 | 828 | $success = $user->setUserData($userData); |
| 829 | 829 | |
| 830 | 830 | if (0 !== strlen($password) && 0 !== strlen($confirm)) { |
@@ -859,13 +859,13 @@ discard block |
||
| 859 | 859 | |
| 860 | 860 | if ($loginExist && ($email == $user->getUserData('email'))) { |
| 861 | 861 | $consonants = array( |
| 862 | - 'b','c','d','f','g','h','j','k','l','m','n','p','r','s','t','v','w','x','y','z', |
|
| 862 | + 'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z', |
|
| 863 | 863 | ); |
| 864 | 864 | $vowels = array( |
| 865 | - 'a','e','i','o','u', |
|
| 865 | + 'a', 'e', 'i', 'o', 'u', |
|
| 866 | 866 | ); |
| 867 | 867 | $newPassword = ''; |
| 868 | - srand((double) microtime() * 1000000); |
|
| 868 | + srand((double)microtime()*1000000); |
|
| 869 | 869 | for ($i = 1; $i <= 4; ++$i) { |
| 870 | 870 | $newPassword .= $consonants[rand(0, 19)]; |
| 871 | 871 | $newPassword .= $vowels[rand(0, 4)]; |
@@ -367,8 +367,8 @@ |
||
| 367 | 367 | define('PMF_GET_KEY_NAME_LANGUAGE', 'lang'); |
| 368 | 368 | define('PMF_GET_KEY_NAME_SESSIONID', 'sid'); |
| 369 | 369 | // Misc parameters |
| 370 | -define('PMF_LANGUAGE_EXPIRED_TIME', 3600); // 30 minutes |
|
| 371 | -define('PMF_SESSION_EXPIRED_TIME', 3600); // 30 minutes |
|
| 370 | +define('PMF_LANGUAGE_EXPIRED_TIME', 3600); // 30 minutes |
|
| 371 | +define('PMF_SESSION_EXPIRED_TIME', 3600); // 30 minutes |
|
| 372 | 372 | define('PMF_REMEMBERME_EXPIRED_TIME', 1209600); // 2 weeks |
| 373 | 373 | |
| 374 | 374 | // |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | foreach ($_records as $_r) { |
| 94 | 94 | ++$i; |
| 95 | 95 | $output = ''; |
| 96 | - $output .= sprintf('%0'.strlen((string) $tot).'d', $i).'/'.$tot.'. Checking '.$_r['solution_id'].' ('.PMF_Utils::makeShorterText(strip_tags($_r['title']), 8).'):'; |
|
| 96 | + $output .= sprintf('%0'.strlen((string)$tot).'d', $i).'/'.$tot.'. Checking '.$_r['solution_id'].' ('.PMF_Utils::makeShorterText(strip_tags($_r['title']), 8).'):'; |
|
| 97 | 97 | $start = microtime(true); |
| 98 | 98 | if ($oLnk->getEntryState($_r['id'], $_r['lang'], true) === true) { |
| 99 | 99 | $output .= $oLnk->verifyArticleURL($_r['content'], $_r['id'], $_r['lang'], true); |
@@ -57,7 +57,7 @@ |
||
| 57 | 57 | |
| 58 | 58 | if (0 < $numItems) { |
| 59 | 59 | $output = []; |
| 60 | - $visibleItems = array_slice($glossaryItems, ($page - 1) * $itemsPerPage, $itemsPerPage); |
|
| 60 | + $visibleItems = array_slice($glossaryItems, ($page - 1)*$itemsPerPage, $itemsPerPage); |
|
| 61 | 61 | |
| 62 | 62 | foreach ($visibleItems as $item) { |
| 63 | 63 | $output['item'][] = $item['item']; |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | // We always need a valid session! |
| 152 | 152 | // |
| 153 | 153 | ini_set('session.use_only_cookies', 1); // Avoid any PHP version to move sessions on URLs |
| 154 | -ini_set('session.auto_start', 0); // Prevent error to use session_start() if it's active in php.ini |
|
| 154 | +ini_set('session.auto_start', 0); // Prevent error to use session_start() if it's active in php.ini |
|
| 155 | 155 | ini_set('session.use_trans_sid', 0); |
| 156 | 156 | ini_set('url_rewriter.tags', ''); |
| 157 | 157 | |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | $tmp = dirname(__DIR__).DIRECTORY_SEPARATOR.$confAttachmentsPath; |
| 185 | 185 | |
| 186 | 186 | // Check that nobody is traversing |
| 187 | - if (0 === strpos((string) $tmp, dirname(__DIR__))) { |
|
| 187 | + if (0 === strpos((string)$tmp, dirname(__DIR__))) { |
|
| 188 | 188 | define('PMF_ATTACHMENTS_DIR', $tmp); |
| 189 | 189 | } else { |
| 190 | 190 | define('PMF_ATTACHMENTS_DIR', false); |
@@ -47,10 +47,10 @@ |
||
| 47 | 47 | $subDirNameLength = 5; |
| 48 | 48 | |
| 49 | 49 | for ($i = 0; $i < $subDirCount; ++$i) { |
| 50 | - $retval .= DIRECTORY_SEPARATOR.substr($fsHash, $i * $subDirNameLength, $subDirNameLength); |
|
| 50 | + $retval .= DIRECTORY_SEPARATOR.substr($fsHash, $i*$subDirNameLength, $subDirNameLength); |
|
| 51 | 51 | } |
| 52 | 52 | |
| 53 | - $retval .= DIRECTORY_SEPARATOR.substr($fsHash, $i * $subDirNameLength); |
|
| 53 | + $retval .= DIRECTORY_SEPARATOR.substr($fsHash, $i*$subDirNameLength); |
|
| 54 | 54 | |
| 55 | 55 | return $retval; |
| 56 | 56 | } |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | * If the target is a string or vanilla object, just move |
| 76 | 76 | * it the simplest way we can. |
| 77 | 77 | */ |
| 78 | - $retval = $this->copyToSimple((string) $target); |
|
| 78 | + $retval = $this->copyToSimple((string)$target); |
|
| 79 | 79 | } else { |
| 80 | 80 | $target->setMode(self::MODE_WRITE); |
| 81 | 81 | while (!$this->eof()) { |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | $message = ''; |
| 130 | 130 | |
| 131 | 131 | if (!is_array($this->errors)) { |
| 132 | - $this->errors = array((string) $this->errors); |
|
| 132 | + $this->errors = array((string)$this->errors); |
|
| 133 | 133 | } |
| 134 | 134 | foreach ($this->errors as $error) { |
| 135 | 135 | $message .= $error."\n"; |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | $oldreadOnly = $this->readOnly; |
| 192 | - $this->readOnly = (bool) $readOnly; |
|
| 192 | + $this->readOnly = (bool)$readOnly; |
|
| 193 | 193 | |
| 194 | 194 | return $oldreadOnly; |
| 195 | 195 | } |