GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 3.0 ( 49ab7a...0a9b70 )
by Thorsten
19:57 queued 13:30
created
phpmyfaq/admin/stat.main.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -148,7 +148,7 @@
 block discarded – undo
148 148
                     </tr>
149 149
                     <tr>
150 150
                         <td><?= $PMF_LANG['ad_stat_vpd'] ?>:</td>
151
-                        <td><?= ($danz != 0) ? round(($vanz / $danz), 2) : 0 ?></td>
151
+                        <td><?= ($danz != 0) ? round(($vanz/$danz), 2) : 0 ?></td>
152 152
                     </tr>
153 153
                     <tr>
154 154
                         <td><?= $PMF_LANG['ad_stat_fien'] ?>:</td>
Please login to merge, or discard this patch.
phpmyfaq/admin/stat.adminlog.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,10 +47,10 @@
 block discarded – undo
47 47
     $page = Filter::filterInput(INPUT_GET, 'page', FILTER_VALIDATE_INT, 1);
48 48
 
49 49
     if (is_null($pages)) {
50
-        $pages = round(($logging->getNumberOfEntries() + ($perpage / 3)) / $perpage, 0);
50
+        $pages = round(($logging->getNumberOfEntries() + ($perpage/3))/$perpage, 0);
51 51
     }
52 52
 
53
-    $start = ($page - 1) * $perpage;
53
+    $start = ($page - 1)*$perpage;
54 54
     $ende = $start + $perpage;
55 55
 
56 56
     $baseUrl = sprintf(
Please login to merge, or discard this patch.
phpmyfaq/admin/stat.ratings.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -115,18 +115,18 @@
 block discarded – undo
115 115
         ?></td>
116 116
                         <td>
117 117
                             <?php
118
-                            if (round($data['num'] * 20) > 75) {
118
+                            if (round($data['num']*20) > 75) {
119 119
                                 $progressBar = 'success';
120
-                            } elseif (round($data['num'] * 20) < 25) {
120
+                            } elseif (round($data['num']*20) < 25) {
121 121
                                 $progressBar = 'danger';
122 122
                             } else {
123 123
                                 $progressBar = 'info';
124 124
                             }
125 125
         ?>
126
-                            <meter value="<?= round($data['num'] * 20);
126
+                            <meter value="<?= round($data['num']*20);
127 127
         ?>" max="100" min="0" low="25" optimum="75"></meter>
128 128
                         </td>
129
-                        <td><?= round($data['num'] * 20);
129
+                        <td><?= round($data['num']*20);
130 130
         ?>%</td>
131 131
                     </tr>
132 132
 <?php
Please login to merge, or discard this patch.
phpmyfaq/admin/session.keepalive.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 if (!$user instanceof CurrentUser) {
56 56
     $user = CurrentUser::getFromSession($faqConfig);
57 57
 }
58
-$refreshTime = (PMF_AUTH_TIMEOUT - PMF_AUTH_TIMEOUT_WARNING) * 60;
58
+$refreshTime = (PMF_AUTH_TIMEOUT - PMF_AUTH_TIMEOUT_WARNING)*60;
59 59
 ?>
60 60
 <!DOCTYPE html>
61 61
 <html lang="<?= $PMF_LANG['metaLanguage']; ?>" class="no-js">
Please login to merge, or discard this patch.
phpmyfaq/admin/user.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     }
73 73
 
74 74
     // validate userAction
75
-    if (!in_array($userAction, $userActionList)){
75
+    if (!in_array($userAction, $userActionList)) {
76 76
         // @Todo: Implement Error message
77 77
     }
78 78
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
         if (!isset($_SESSION['phpmyfaq_csrf_token']) || $_SESSION['phpmyfaq_csrf_token'] !== $csrfToken) {
87 87
             $csrfOkay = false;
88 88
         }
89
-        if (0 === (int) $userId || !$csrfOkay) {
89
+        if (0 === (int)$userId || !$csrfOkay) {
90 90
             $message .= sprintf('<p class="alert alert-danger">%s</p>', $PMF_LANG['ad_user_error_noId']);
91 91
         } else {
92 92
             $user = new User($faqConfig);
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             $csrfOkay = false;
211 211
         }
212 212
         $userAction = $defaultUserAction;
213
-        if (0 === (int) $userId || !$csrfOkay) {
213
+        if (0 === (int)$userId || !$csrfOkay) {
214 214
             $message .= sprintf('<p class="alert alert-danger">%s</p>', $PMF_LANG['ad_user_error_noId']);
215 215
         } else {
216 216
             if (!$user->getUserById($userId, true)) {
@@ -638,8 +638,8 @@  discard block
 block discarded – undo
638 638
         $numUsers = count($allUsers);
639 639
         $page = Filter::filterInput(INPUT_GET, 'page', FILTER_VALIDATE_INT, 0);
640 640
         $perPage = 10;
641
-        $numPages = ceil($numUsers / $perPage);
642
-        $lastPage = $page * $perPage;
641
+        $numPages = ceil($numUsers/$perPage);
642
+        $lastPage = $page*$perPage;
643 643
         $firstPage = $lastPage - $perPage;
644 644
 
645 645
         $baseUrl = sprintf(
Please login to merge, or discard this patch.
phpmyfaq/admin/record.comments.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,9 +82,9 @@
 block discarded – undo
82 82
                     </a> |
83 83
                     <?= $date->format(date('Y-m-d H:i', $faqcomment['date'])) ?> |
84 84
                     <a href="<?php printf('../?action=faq&cat=%d&id=%d&artlang=%s',
85
-                       $faqcomment['category_id'],
86
-                       $faqcomment['record_id'],
87
-                       $LANGCODE) ?>">
85
+                        $faqcomment['category_id'],
86
+                        $faqcomment['record_id'],
87
+                        $LANGCODE) ?>">
88 88
                         <?= $faq->getRecordTitle($faqcomment['record_id']) ?>
89 89
                     </a>
90 90
                 </span><br/>
Please login to merge, or discard this patch.
phpmyfaq/admin/category.add.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -137,12 +137,12 @@  discard block
 block discarded – undo
137 137
                         <div class="col-lg-4">
138 138
                           <select name="group_id" id="group_id" class="form-control">
139 139
                               <?php
140
-                              if ($faqConfig->get('main.enableCategoryRestrictions')) {
141
-                                  echo $user->perm->getAllGroupsOptions([], $currentUserId);
142
-                              } else {
143
-                                  echo $user->perm->getAllGroupsOptions([]);
144
-                              }
145
-                              ?>
140
+                                if ($faqConfig->get('main.enableCategoryRestrictions')) {
141
+                                    echo $user->perm->getAllGroupsOptions([], $currentUserId);
142
+                                } else {
143
+                                    echo $user->perm->getAllGroupsOptions([]);
144
+                                }
145
+                                ?>
146 146
                           </select>
147 147
                         </div>
148 148
                       </div>
@@ -165,12 +165,12 @@  discard block
 block discarded – undo
165 165
                               </label>
166 166
                               <select name="restricted_groups[]" size="3" class="form-control" multiple>
167 167
                                   <?php
168
-                                  if ($faqConfig->get('main.enableCategoryRestrictions')) {
169
-                                      echo $user->perm->getAllGroupsOptions([], $currentUserId);
170
-                                  } else {
171
-                                      echo $user->perm->getAllGroupsOptions([]);
172
-                                  }
173
-                                  ?>
168
+                                    if ($faqConfig->get('main.enableCategoryRestrictions')) {
169
+                                        echo $user->perm->getAllGroupsOptions([], $currentUserId);
170
+                                    } else {
171
+                                        echo $user->perm->getAllGroupsOptions([]);
172
+                                    }
173
+                                    ?>
174 174
                               </select>
175 175
                             </div>
176 176
                           </div>
Please login to merge, or discard this patch.
phpmyfaq/admin/ajax.image.php 2 patches
Switch Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -40,46 +40,46 @@
 block discarded – undo
40 40
 }
41 41
 switch ($ajaxAction) {
42 42
 
43
-    case 'upload':
43
+        case 'upload':
44 44
 
45
-        $uploadDir = '../images/';
46
-        $validFileExtensions = ['gif', 'jpg', 'jpeg', 'png'];
47
-        if ($csrfOkay) {
48
-            reset($_FILES);
49
-            $temp = current($_FILES);
50
-            if (is_uploaded_file($temp['tmp_name'])) {
51
-                if (isset($_SERVER['HTTP_ORIGIN'])) {
52
-                    if ($_SERVER['HTTP_ORIGIN'] . '/' === $faqConfig->getDefaultUrl()) {
53
-                        $http->sendCorsHeader();
54
-                    } else {
55
-                        $http->sendStatus(403);
56
-                        return;
45
+            $uploadDir = '../images/';
46
+            $validFileExtensions = ['gif', 'jpg', 'jpeg', 'png'];
47
+            if ($csrfOkay) {
48
+                reset($_FILES);
49
+                $temp = current($_FILES);
50
+                if (is_uploaded_file($temp['tmp_name'])) {
51
+                    if (isset($_SERVER['HTTP_ORIGIN'])) {
52
+                        if ($_SERVER['HTTP_ORIGIN'] . '/' === $faqConfig->getDefaultUrl()) {
53
+                            $http->sendCorsHeader();
54
+                        } else {
55
+                            $http->sendStatus(403);
56
+                            return;
57
+                        }
57 58
                     }
58
-                }
59 59
 
60
-                // Sanitize input
61
-                if (preg_match("/([^\w\s\d\-_~,;:\[\]\(\).])|([\.]{2,})/", $temp['name'])) {
62
-                    $http->sendStatus(400);
63
-                    return;
64
-                }
60
+                    // Sanitize input
61
+                    if (preg_match("/([^\w\s\d\-_~,;:\[\]\(\).])|([\.]{2,})/", $temp['name'])) {
62
+                        $http->sendStatus(400);
63
+                        return;
64
+                    }
65 65
 
66
-                // Verify extension
67
-                if (!in_array(strtolower(pathinfo($temp['name'], PATHINFO_EXTENSION)), $validFileExtensions)) {
68
-                    $http->sendStatus(400);
69
-                    return;
70
-                }
66
+                    // Verify extension
67
+                    if (!in_array(strtolower(pathinfo($temp['name'], PATHINFO_EXTENSION)), $validFileExtensions)) {
68
+                        $http->sendStatus(400);
69
+                        return;
70
+                    }
71 71
 
72
-                // Accept upload if there was no origin, or if it is an accepted origin
73
-                $fileToWrite = $uploadDir . $temp['name'];
74
-                move_uploaded_file($temp['tmp_name'], $fileToWrite);
72
+                    // Accept upload if there was no origin, or if it is an accepted origin
73
+                    $fileToWrite = $uploadDir . $temp['name'];
74
+                    move_uploaded_file($temp['tmp_name'], $fileToWrite);
75 75
 
76
-                // Respond to the successful upload with JSON.
77
-                $http->sendJsonWithHeaders(['location' => $fileToWrite]);
76
+                    // Respond to the successful upload with JSON.
77
+                    $http->sendJsonWithHeaders(['location' => $fileToWrite]);
78
+                } else {
79
+                    $http->sendStatus(500);
80
+                }
78 81
             } else {
79
-                $http->sendStatus(500);
82
+                $http->sendStatus(401);
80 83
             }
81
-        } else {
82
-            $http->sendStatus(401);
83
-        }
84
-        break;
84
+            break;
85 85
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
     if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') {
24 24
         $protocol = 'https';
25 25
     }
26
-    header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
26
+    header('Location: '.$protocol.'://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']));
27 27
     exit();
28 28
 }
29 29
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             $temp = current($_FILES);
50 50
             if (is_uploaded_file($temp['tmp_name'])) {
51 51
                 if (isset($_SERVER['HTTP_ORIGIN'])) {
52
-                    if ($_SERVER['HTTP_ORIGIN'] . '/' === $faqConfig->getDefaultUrl()) {
52
+                    if ($_SERVER['HTTP_ORIGIN'].'/' === $faqConfig->getDefaultUrl()) {
53 53
                         $http->sendCorsHeader();
54 54
                     } else {
55 55
                         $http->sendStatus(403);
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                 }
71 71
 
72 72
                 // Accept upload if there was no origin, or if it is an accepted origin
73
-                $fileToWrite = $uploadDir . $temp['name'];
73
+                $fileToWrite = $uploadDir.$temp['name'];
74 74
                 move_uploaded_file($temp['tmp_name'], $fileToWrite);
75 75
 
76 76
                 // Respond to the successful upload with JSON.
Please login to merge, or discard this patch.
phpmyfaq/admin/ajax.records.php 2 patches
Switch Indentation   +86 added lines, -86 removed lines patch added patch discarded remove patch
@@ -54,101 +54,101 @@
 block discarded – undo
54 54
 switch ($ajax_action) {
55 55
 
56 56
     // save active FAQs
57
-    case 'save_active_records':
58
-        if ($user->perm->checkRight($user->getUserId(), 'approverec')) {
59
-            if (!empty($items)) {
60
-                $faq = new Faq($faqConfig);
61
-
62
-                foreach ($items as $item) {
63
-                    if (is_array($item) && count($item) == 3 && Language::isASupportedLanguage($item[1])) {
64
-                        echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'active');
57
+        case 'save_active_records':
58
+            if ($user->perm->checkRight($user->getUserId(), 'approverec')) {
59
+                if (!empty($items)) {
60
+                    $faq = new Faq($faqConfig);
61
+
62
+                    foreach ($items as $item) {
63
+                        if (is_array($item) && count($item) == 3 && Language::isASupportedLanguage($item[1])) {
64
+                            echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'active');
65
+                        }
65 66
                     }
66 67
                 }
68
+            } else {
69
+                echo $PMF_LANG['err_NotAuth'];
67 70
             }
68
-        } else {
69
-            echo $PMF_LANG['err_NotAuth'];
70
-        }
71
-        break;
72
-
73
-    // save sticky FAQs
74
-    case 'save_sticky_records':
75
-        if ($user->perm->checkRight($user->getUserId(), 'edit_faq')) {
76
-            if (!empty($items)) {
71
+            break;
72
+
73
+        // save sticky FAQs
74
+        case 'save_sticky_records':
75
+            if ($user->perm->checkRight($user->getUserId(), 'edit_faq')) {
76
+                if (!empty($items)) {
77
+                    $faq = new Faq($faqConfig);
78
+
79
+                    foreach ($items as $item) {
80
+                        if (is_array($item) && count($item) == 3 && Language::isASupportedLanguage($item[1])) {
81
+                            echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'sticky');
82
+                        }
83
+                    }
84
+                }
85
+            } else {
86
+                echo $PMF_LANG['err_NotAuth'];
87
+            }
88
+            break;
89
+
90
+        // search FAQs for suggestions
91
+        case 'search_records':
92
+            if ($user->perm->checkRight($user->getUserId(), 'edit_faq')) {
77 93
                 $faq = new Faq($faqConfig);
94
+                $faqSearch = new Search($faqConfig);
95
+                $faqSearch->setCategory(new Category($faqConfig));
96
+                $faqSearchResult = new Resultset($user, $faq, $faqConfig);
97
+                $searchResult = '';
98
+                $searchString = Filter::filterInput(INPUT_POST, 'search', FILTER_SANITIZE_STRIPPED);
99
+
100
+                if (!is_null($searchString)) {
101
+                    try {
102
+                        $searchResult = $faqSearch->search($searchString, false);
78 103
 
79
-                foreach ($items as $item) {
80
-                    if (is_array($item) && count($item) == 3 && Language::isASupportedLanguage($item[1])) {
81
-                        echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'sticky');
104
+                        $faqSearchResult->reviewResultset($searchResult);
105
+
106
+                        $searchHelper = new SearchHelper($faqConfig);
107
+                        $searchHelper->setSearchterm($searchString);
108
+
109
+                        echo $searchHelper->renderAdminSuggestionResult($faqSearchResult);
110
+                    } catch (Search\Exception $e) {
111
+                        //
82 112
                     }
83 113
                 }
114
+            } else {
115
+                echo $PMF_LANG['err_NotAuth'];
84 116
             }
85
-        } else {
86
-            echo $PMF_LANG['err_NotAuth'];
87
-        }
88
-        break;
89
-
90
-    // search FAQs for suggestions
91
-    case 'search_records':
92
-        if ($user->perm->checkRight($user->getUserId(), 'edit_faq')) {
93
-            $faq = new Faq($faqConfig);
94
-            $faqSearch = new Search($faqConfig);
95
-            $faqSearch->setCategory(new Category($faqConfig));
96
-            $faqSearchResult = new Resultset($user, $faq, $faqConfig);
97
-            $searchResult = '';
98
-            $searchString = Filter::filterInput(INPUT_POST, 'search', FILTER_SANITIZE_STRIPPED);
99
-
100
-            if (!is_null($searchString)) {
101
-                try {
102
-                    $searchResult = $faqSearch->search($searchString, false);
103
-
104
-                    $faqSearchResult->reviewResultset($searchResult);
105
-
106
-                    $searchHelper = new SearchHelper($faqConfig);
107
-                    $searchHelper->setSearchterm($searchString);
108
-
109
-                    echo $searchHelper->renderAdminSuggestionResult($faqSearchResult);
110
-                } catch (Search\Exception $e) {
111
-                    //
112
-                }
117
+            break;
118
+
119
+        // delete FAQs
120
+        case 'delete_record':
121
+            if ($user->perm->checkRight($user->getUserId(), 'delete_faq')) {
122
+                $recordId = Filter::filterInput(INPUT_POST, 'record_id', FILTER_VALIDATE_INT);
123
+                $recordLang = Filter::filterInput(INPUT_POST, 'record_lang', FILTER_SANITIZE_STRING);
124
+
125
+                $logging = new Logging($faqConfig);
126
+                $logging->logAdmin($user, 'Deleted FAQ ID '.$recordId);
127
+
128
+                $faq->deleteRecord($recordId, $recordLang);
129
+                echo $PMF_LANG['ad_entry_delsuc'];
130
+            } else {
131
+                echo $PMF_LANG['err_NotAuth'];
113 132
             }
114
-        } else {
115
-            echo $PMF_LANG['err_NotAuth'];
116
-        }
117
-        break;
118
-
119
-    // delete FAQs
120
-    case 'delete_record':
121
-        if ($user->perm->checkRight($user->getUserId(), 'delete_faq')) {
122
-            $recordId = Filter::filterInput(INPUT_POST, 'record_id', FILTER_VALIDATE_INT);
123
-            $recordLang = Filter::filterInput(INPUT_POST, 'record_lang', FILTER_SANITIZE_STRING);
124
-
125
-            $logging = new Logging($faqConfig);
126
-            $logging->logAdmin($user, 'Deleted FAQ ID '.$recordId);
127
-
128
-            $faq->deleteRecord($recordId, $recordLang);
129
-            echo $PMF_LANG['ad_entry_delsuc'];
130
-        } else {
131
-            echo $PMF_LANG['err_NotAuth'];
132
-        }
133
-        break;
134
-
135
-    // delete open questions
136
-    case 'delete_question':
137
-        if ($user->perm->checkRight($user->getUserId(), 'delquestion')) {
138
-            $checks = array(
139
-                'filter' => FILTER_VALIDATE_INT,
140
-                'flags' => FILTER_REQUIRE_ARRAY,
141
-            );
142
-            $questionIds = Filter::filterInputArray(INPUT_POST, array('questions' => $checks));
143
-
144
-            if (!is_null($questionIds['questions'])) {
145
-                foreach ($questionIds['questions'] as $questionId) {
146
-                    $faq->deleteQuestion((int) $questionId);
133
+            break;
134
+
135
+        // delete open questions
136
+        case 'delete_question':
137
+            if ($user->perm->checkRight($user->getUserId(), 'delquestion')) {
138
+                $checks = array(
139
+                    'filter' => FILTER_VALIDATE_INT,
140
+                    'flags' => FILTER_REQUIRE_ARRAY,
141
+                );
142
+                $questionIds = Filter::filterInputArray(INPUT_POST, array('questions' => $checks));
143
+
144
+                if (!is_null($questionIds['questions'])) {
145
+                    foreach ($questionIds['questions'] as $questionId) {
146
+                        $faq->deleteQuestion((int) $questionId);
147
+                    }
147 148
                 }
149
+                echo $PMF_LANG['ad_entry_delsuc'];
150
+            } else {
151
+                echo $PMF_LANG['err_NotAuth'];
148 152
             }
149
-            echo $PMF_LANG['ad_entry_delsuc'];
150
-        } else {
151
-            echo $PMF_LANG['err_NotAuth'];
152
-        }
153
-        break;
153
+            break;
154 154
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 
62 62
                 foreach ($items as $item) {
63 63
                     if (is_array($item) && count($item) == 3 && Language::isASupportedLanguage($item[1])) {
64
-                        echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'active');
64
+                        echo $faq->updateRecordFlag((int)$item[0], addslashes($item[1]), $item[2], 'active');
65 65
                     }
66 66
                 }
67 67
             }
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
                 foreach ($items as $item) {
80 80
                     if (is_array($item) && count($item) == 3 && Language::isASupportedLanguage($item[1])) {
81
-                        echo $faq->updateRecordFlag((int) $item[0], addslashes($item[1]), $item[2], 'sticky');
81
+                        echo $faq->updateRecordFlag((int)$item[0], addslashes($item[1]), $item[2], 'sticky');
82 82
                     }
83 83
                 }
84 84
             }
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 
144 144
             if (!is_null($questionIds['questions'])) {
145 145
                 foreach ($questionIds['questions'] as $questionId) {
146
-                    $faq->deleteQuestion((int) $questionId);
146
+                    $faq->deleteQuestion((int)$questionId);
147 147
                 }
148 148
             }
149 149
             echo $PMF_LANG['ad_entry_delsuc'];
Please login to merge, or discard this patch.