1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* AJAX: onDemandURL. |
4
|
|
|
* |
5
|
|
|
* Usage: |
6
|
|
|
* index.php?action=ajax&ajax=onDemandURL&id=<id>&artlang=<lang>[&lookup=1] |
7
|
|
|
* |
8
|
|
|
* Performs link verification at demand of the user. |
9
|
|
|
* |
10
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public License, |
11
|
|
|
* v. 2.0. If a copy of the MPL was not distributed with this file, You can |
12
|
|
|
* obtain one at http://mozilla.org/MPL/2.0/. |
13
|
|
|
* |
14
|
|
|
* The Initial Developer of the Original Code is released for external use |
15
|
|
|
* with permission from NetJapan, Inc. IT Administration Group. |
16
|
|
|
* |
17
|
|
|
* @package phpMyFAQ |
18
|
|
|
* @author Minoru TODA <[email protected]> |
19
|
|
|
* @author Thorsten Rinne <[email protected]> |
20
|
|
|
* @copyright 2005-2019 NetJapan, Inc. |
21
|
|
|
* @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
22
|
|
|
* @link https://www.phpmyfaq.de |
23
|
|
|
* @since 2005-09-30 |
24
|
|
|
*/ |
25
|
|
|
|
26
|
|
|
use phpMyFAQ\Filter; |
27
|
|
|
use phpMyFAQ\Helper\HttpHelper; |
28
|
|
|
use phpMyFAQ\Linkverifier; |
29
|
|
|
|
30
|
|
View Code Duplication |
if (!defined('IS_VALID_PHPMYFAQ')) { |
31
|
|
|
$protocol = 'http'; |
32
|
|
|
if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON') { |
33
|
|
|
$protocol = 'https'; |
34
|
|
|
} |
35
|
|
|
header('Location: '.$protocol.'://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME'])); |
36
|
|
|
exit(); |
37
|
|
|
} |
38
|
|
|
|
39
|
|
|
$httpHeader = new HttpHelper(); |
40
|
|
|
$httpHeader->setContentType('text/html'); |
41
|
|
|
$httpHeader->addHeader(); |
42
|
|
|
|
43
|
|
|
$linkVerifier = new Linkverifier($faqConfig, $user->getLogin()); |
44
|
|
View Code Duplication |
if ($linkVerifier->isReady() === false) { |
45
|
|
|
if (count(ob_list_handlers()) > 0) { |
46
|
|
|
ob_clean(); |
47
|
|
|
} |
48
|
|
|
echo 'disabled'; |
49
|
|
|
exit(); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
$id = Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT); |
53
|
|
|
$artlang = Filter::filterInput(INPUT_GET, 'artlang', FILTER_SANITIZE_STRING); |
54
|
|
|
$lookup = Filter::filterInput(INPUT_GET, 'lookup', FILTER_VALIDATE_INT); |
55
|
|
|
|
56
|
|
|
if (count(ob_list_handlers()) > 0) { |
57
|
|
|
ob_clean(); |
58
|
|
|
} |
59
|
|
|
?> |
60
|
|
|
<!DOCTYPE html> |
61
|
|
|
<!--[if IE 9 ]> <html lang="<?= $PMF_LANG['metaLanguage']; ?>" class="no-js ie9"> <![endif]--> |
62
|
|
|
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="<?= $PMF_LANG['metaLanguage']; ?>" class="no-js"> <!--<![endif]--> |
63
|
|
|
<head> |
64
|
|
|
<meta charset="utf-8"> |
65
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
66
|
|
|
|
67
|
|
|
<title><?= $faqConfig->get('main.titleFAQ'); ?> - powered by phpMyFAQ</title> |
68
|
|
|
<base href="<?= $faqConfig->getDefaultUrl(); ?>"> |
69
|
|
|
|
70
|
|
|
<meta name="description" content="Only Chuck Norris can divide by zero."> |
71
|
|
|
<meta name="author" content="phpMyFAQ Team"> |
72
|
|
|
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"> |
73
|
|
|
<meta name="application-name" content="phpMyFAQ <?= $faqConfig->get('main.currentVersion'); ?>"> |
74
|
|
|
<meta name="copyright" content="(c) 2001-2019 phpMyFAQ Team"> |
75
|
|
|
<meta name="publisher" content="phpMyFAQ Team"> |
76
|
|
|
<meta name="MSSmartTagsPreventParsing" content="true"> |
77
|
|
|
|
78
|
|
|
<link rel="stylesheet" href="assets/css/style.min.css?v=1"> |
79
|
|
|
|
80
|
|
|
<script src="../assets/js/phpmyfaq.min.js"></script> |
81
|
|
|
|
82
|
|
|
</head> |
83
|
|
|
<body dir="<?= $PMF_LANG['dir']; ?>"> |
84
|
|
|
<?php |
85
|
|
|
|
86
|
|
|
if (!(isset($id) && isset($artlang))) { |
87
|
|
|
?> |
88
|
|
|
Error: Entry ID and Language needs to be specified. |
89
|
|
|
</body> |
90
|
|
|
</html> |
91
|
|
|
<?php |
92
|
|
|
exit(); |
93
|
|
|
} |
94
|
|
|
|
95
|
|
|
$faq->faqRecord = null; |
96
|
|
|
$faq->getRecord($id, null, true); |
97
|
|
|
|
98
|
|
|
if (!isset($faq->faqRecord['content'])) { |
99
|
|
|
?> |
100
|
|
|
Error: No entry for #<?= $id ?>(<?= $artlang ?>) available. |
101
|
|
|
</body> |
102
|
|
|
</html> |
103
|
|
|
<?php |
104
|
|
|
exit(); |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
if (!is_null($lookup)) { |
108
|
|
|
if (count(ob_list_handlers()) > 0) { |
109
|
|
|
ob_clean(); |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
echo $linkVerifier->verifyArticleURL($faq->faqRecord['content'], $id, $artlang); |
113
|
|
|
exit(); |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
?> |
117
|
|
|
<?php Linkverifier::linkOndemandJavascript($id, $artlang); ?> |
|
|
|
|
118
|
|
|
</body> |
119
|
|
|
</html> |
120
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.