This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | /** |
||
3 | * The start page with some information about the FAQ. |
||
4 | * |
||
5 | * |
||
6 | * |
||
7 | * This Source Code Form is subject to the terms of the Mozilla Public License, |
||
8 | * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
||
9 | * obtain one at http://mozilla.org/MPL/2.0/. |
||
10 | * |
||
11 | * @package phpMyFAQ |
||
12 | * |
||
13 | * @author Thorsten Rinne <[email protected]> |
||
14 | * @author Alexander M. Turek <[email protected]> |
||
15 | * @copyright 2005-2019 phpMyFAQ Team |
||
16 | * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
||
17 | * |
||
18 | * @link https://www.phpmyfaq.de |
||
19 | * @since 2013-02-05 |
||
20 | */ |
||
21 | |||
22 | use phpMyFAQ\Api; |
||
23 | use phpMyFAQ\Db; |
||
24 | use phpMyFAQ\Exception; |
||
0 ignored issues
–
show
|
|||
25 | use phpMyFAQ\Filter; |
||
26 | use phpMyFAQ\Session; |
||
27 | use phpMyFAQ\System; |
||
28 | |||
29 | View Code Duplication | if (!defined('IS_VALID_PHPMYFAQ')) { |
|
30 | $protocol = 'http'; |
||
31 | if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') { |
||
32 | $protocol = 'https'; |
||
33 | } |
||
34 | header('Location: '.$protocol.'://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])); |
||
35 | exit(); |
||
36 | } |
||
37 | |||
38 | $faqTableInfo = $faqConfig->getDb()->getTableStatus(Db::getTablePrefix()); |
||
39 | $faqSystem = new System(); |
||
40 | $faqSession = new Session($faqConfig); |
||
41 | ?> |
||
42 | <div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom"> |
||
43 | <h1 class="h2"> |
||
44 | <i aria-hidden="true" class="fas fa-tachometer-alt"></i> |
||
45 | <?= $PMF_LANG['admin_mainmenu_home'] ?> |
||
46 | </h1> |
||
47 | <div class="btn-toolbar mb-2 mb-md-0"> |
||
48 | <div class="btn-group mr-2"> |
||
49 | <a href="?action=config"> |
||
50 | <?php if ($faqConfig->get('main.maintenanceMode')): ?> |
||
51 | <button class="btn btn-sm btn-outline-danger"><?= $PMF_LANG['msgMaintenanceMode'] ?></button> |
||
52 | <?php else: ?> |
||
53 | <button class="btn btn-sm btn-outline-success"><?= $PMF_LANG['msgOnlineMode'] ?></button> |
||
54 | <?php endif; ?> |
||
55 | </a> |
||
56 | </div> |
||
57 | </div> |
||
58 | </div> |
||
59 | |||
60 | <?php if (version_compare($faqConfig->getCurrentVersion(), System::getVersion(), '<')): ?> |
||
61 | <div class="alert alert-danger" role="alert"> |
||
62 | <h4 class="alert-heading">Attention!</h4> |
||
63 | <p> |
||
64 | The version number stored in your database is lower than your installed version, please update your installation |
||
65 | <a href="../setup/update.php" class="alert-link">here</a> to avoid an unintended behaviour. |
||
66 | </p> |
||
67 | </div> |
||
68 | <?php endif; ?> |
||
69 | |||
70 | <section class="row"> |
||
71 | <div class="col-lg-12"> |
||
72 | <div class="card-columns"> |
||
73 | |||
74 | <?php if ($faqConfig->get('main.enableUserTracking')): ?> |
||
75 | <div class="card border-dark"> |
||
76 | <div class="card-header"> |
||
77 | <i aria-hidden="true" class="fas fa-chart-line"></i> <?= $PMF_LANG['ad_stat_report_visits'] ?> |
||
78 | </div> |
||
79 | <div class="card-body"> |
||
80 | <?php |
||
81 | $session = new Session($faqConfig); |
||
82 | $visits = $session->getLast30DaysVisits(); |
||
83 | ?> |
||
84 | <script src="assets/js/plugins/jquery.sparkline.min.js"></script> |
||
85 | <script> |
||
86 | $(function () { |
||
87 | const visits = [<?= implode(',', $visits) ?>]; |
||
88 | $('.visits').sparkline( |
||
89 | visits, { |
||
90 | type: 'bar', |
||
91 | barColor: '#7797b2', |
||
92 | barWidth: 12, |
||
93 | height: 268, |
||
94 | tooltipSuffix: ' <?= $PMF_LANG['ad_visits_per_day'] ?>' |
||
95 | }); |
||
96 | }); |
||
97 | </script> |
||
98 | <span class="visits">Loading...</span> |
||
99 | </div> |
||
100 | </div> |
||
101 | <?php endif; ?> |
||
102 | |||
103 | <div class="card border-dark"> |
||
104 | <div class="card-header"> |
||
105 | <i aria-hidden="true" class="fas fa-info-circle"></i> <?= $PMF_LANG['ad_pmf_info'] ?> |
||
106 | </div> |
||
107 | <div class="card-body"> |
||
108 | <div class="list-group-flush"> |
||
109 | <a href="?action=viewsessions" class="list-group-item"> |
||
110 | <i aria-hidden="true" class="fas fa-chart-bar"></i> <?= $PMF_LANG['ad_start_visits'] ?> |
||
111 | <span class="float-right text-muted small"> |
||
112 | <em><?= $faqSession->getNumberOfSessions() ?></em> |
||
113 | </span> |
||
114 | </a> |
||
115 | <a href="?action=view" class="list-group-item"> |
||
116 | <i aria-hidden="true" class="fas fa-list-alt"></i> <?= $PMF_LANG['ad_start_articles']; ?> |
||
117 | <span class="float-right text-muted small"> |
||
118 | <em><?= $faqTableInfo[Db::getTablePrefix().'faqdata']; ?></em> |
||
119 | </span> |
||
120 | </a> |
||
121 | <a href="?action=comments" class="list-group-item"> |
||
122 | <i aria-hidden="true" class="fas fa-comments"></i> <?= $PMF_LANG['ad_start_comments']; ?> |
||
123 | <span class="float-right text-muted small"> |
||
124 | <em><?= $faqTableInfo[Db::getTablePrefix().'faqcomments']; ?></em> |
||
125 | </span> |
||
126 | </a> |
||
127 | <a href="?action=question" class="list-group-item"> |
||
128 | <i aria-hidden="true" class="fas fa-question-circle"></i> <?= $PMF_LANG['msgOpenQuestions']; ?> |
||
129 | <span class="float-right text-muted small"> |
||
130 | <em><?= $faqTableInfo[Db::getTablePrefix().'faqquestions']; ?></em> |
||
131 | </span> |
||
132 | </a> |
||
133 | <a href="?action=news" class="list-group-item"> |
||
134 | <i aria-hidden="true" class="fas fa-list-alt"></i> <?= $PMF_LANG['msgNews']; ?> |
||
135 | <span class="float-right text-muted small"> |
||
136 | <em><?= $faqTableInfo[Db::getTablePrefix().'faqnews']; ?></em> |
||
137 | </span> |
||
138 | </a> |
||
139 | <a href="?action=user&user_action=listallusers" class="list-group-item"> |
||
140 | <i aria-hidden="true" class="fas fa-users"></i> <?= $PMF_LANG['admin_mainmenu_users']; ?> |
||
141 | <span class="float-right text-muted small"> |
||
142 | <em><?= $faqTableInfo[Db::getTablePrefix().'faquser'] - 1; ?></em> |
||
143 | </span> |
||
144 | </a> |
||
145 | <a target="_blank" href="https://itunes.apple.com/app/phpmyfaq/id977896957" class="list-group-item"> |
||
146 |  Available on the App Store |
||
147 | <span class="float-right text-muted small"><i aria-hidden="true" class="fas fa-heart"></i></span> |
||
148 | </a> |
||
149 | </div> |
||
150 | </div> |
||
151 | </div> |
||
152 | |||
153 | <div class="card border-dark"> |
||
154 | <div class="card-header"> |
||
155 | <i aria-hidden="true" class="fas fa-ban"></i> <?= $PMF_LANG['ad_record_inactive']; ?> |
||
156 | </div> |
||
157 | <div class="card-body"> |
||
158 | <ul class="list-unstyled"> |
||
159 | <?php |
||
160 | $inactiveFaqs = $faq->getInactiveFaqsData(); |
||
161 | foreach ($inactiveFaqs as $inactiveFaq) { |
||
162 | printf( |
||
163 | '<li><a href="%s">%s</a></li>', |
||
164 | $inactiveFaq['url'], |
||
165 | $inactiveFaq['question'] |
||
166 | ); |
||
167 | } |
||
168 | ?> |
||
169 | </ul> |
||
170 | </div> |
||
171 | </div> |
||
172 | |||
173 | <?php if ($user->perm->checkRight($user->getUserId(), 'editconfig')): ?> |
||
174 | <div class="card border-dark"> |
||
175 | <div class="card-header"> |
||
176 | <i aria-hidden="true" class="fas fa-check-double"></i> <?= $PMF_LANG['ad_online_info']; ?> |
||
177 | </div> |
||
178 | <div class="card-body"> |
||
179 | <?php |
||
180 | $version = Filter::filterInput(INPUT_POST, 'param', FILTER_SANITIZE_STRING); |
||
181 | if ($faqConfig->get('main.enableAutoUpdateHint') || (!is_null($version) && $version == 'version')) { |
||
182 | $api = new Api($faqConfig, new System()); |
||
183 | try { |
||
184 | $versions = $api->getVersions(); |
||
185 | printf( |
||
186 | '<p class="alert alert-%s">%s <a href="https://www.phpmyfaq.de" target="_blank">phpmyfaq.de</a>: <strong>phpMyFAQ %s</strong>', |
||
187 | (-1 == version_compare($versions['installed'], $versions['current'])) ? 'danger' : 'dark', |
||
188 | $PMF_LANG['ad_xmlrpc_latest'], |
||
189 | $versions['current'] |
||
190 | ); |
||
191 | // Installed phpMyFAQ version is outdated |
||
192 | if (-1 == version_compare($versions['installed'], $versions['current'])) { |
||
193 | echo '<br />'.$PMF_LANG['ad_you_should_update']; |
||
194 | } |
||
195 | } catch (Exception $e) { |
||
196 | printf('<p class="alert alert-danger">%s</p>', $e->getMessage()); |
||
197 | } |
||
198 | } else { |
||
199 | ?> |
||
200 | <form action="<?= $faqSystem->getSystemUri($faqConfig) ?>admin/index.php" method="post" |
||
201 | accept-charset="utf-8"> |
||
202 | <input type="hidden" name="param" value="version"/> |
||
203 | <button class="btn btn-primary" type="submit"> |
||
204 | <i aria-hidden="true" class="fas fa-check fa fa-white"></i> <?= $PMF_LANG['ad_xmlrpc_button']; |
||
205 | ?> |
||
206 | </button> |
||
207 | </form> |
||
208 | <?php |
||
209 | } |
||
210 | ?> |
||
211 | </div> |
||
212 | </div> |
||
213 | |||
214 | <div class="card border-dark"> |
||
215 | <div class="card-header"> |
||
216 | <i aria-hidden="true" class="fas fa-certificate fa-fw"></i> <?= $PMF_LANG['ad_online_verification'] ?> |
||
217 | </div> |
||
218 | <div class="card-body"> |
||
219 | <?php |
||
220 | $getJson = Filter::filterInput(INPUT_POST, 'getJson', FILTER_SANITIZE_STRING); |
||
221 | if (!is_null($getJson) && 'verify' === $getJson) { |
||
222 | $api = new Api($faqConfig, new System()); |
||
223 | try { |
||
224 | if (!$api->isVerified()) { |
||
225 | echo '<p class="alert alert-danger">phpMyFAQ version mismatch - no verification possible.</p>'; |
||
226 | } else { |
||
227 | $issues = $api->getVerificationIssues(); |
||
228 | if (1 < count($issues)) { |
||
229 | printf('<p class="alert alert-danger">%s</p>', $PMF_LANG['ad_verification_notokay']); |
||
230 | echo '<ul>'; |
||
231 | foreach ($issues as $file => $hash) { |
||
232 | if ('created' === $file) { |
||
233 | continue; |
||
234 | } |
||
235 | printf( |
||
236 | '<li><span class="pmf-popover" data-original-title="SHA-1" data-content="%s">%s</span></li>', |
||
237 | $hash, |
||
238 | $file |
||
239 | ); |
||
240 | } |
||
241 | echo '</ul>'; |
||
242 | } else { |
||
243 | printf('<p class="alert alert-success">%s</p>', $PMF_LANG['ad_verification_okay']); |
||
244 | } |
||
245 | } |
||
246 | } catch (Exception $e) { |
||
247 | printf('<p class="alert alert-danger">%s</p>', $e->getMessage()); |
||
248 | } |
||
249 | } else { |
||
250 | ?> |
||
251 | <form action="<?= $faqSystem->getSystemUri($faqConfig) ?>admin/index.php" method="post" |
||
252 | accept-charset="utf-8"> |
||
253 | <input type="hidden" name="getJson" value="verify"/> |
||
254 | <button class="btn btn-primary" type="submit"> |
||
255 | <i aria-hidden="true" |
||
256 | class="fas fa-certificate fa fa-white"></i> <?= $PMF_LANG['ad_verification_button'] ?> |
||
257 | </button> |
||
258 | </form> |
||
259 | <?php |
||
260 | } |
||
261 | ?> |
||
262 | <script>$(function () { |
||
263 | $('span[class="pmf-popover"]').popover(); |
||
264 | });</script> |
||
265 | </div> |
||
266 | </div> |
||
267 | <?php endif; ?> |
||
268 | |||
269 | </div> |
||
270 | </section> |
||
271 | |||
272 |
Let’s assume that you have a directory layout like this:
and let’s assume the following content of
Bar.php
:If both files
OtherDir/Foo.php
andSomeDir/Foo.php
are loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as
OtherDir/Foo.php
does not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php
, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: