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.
1 | <?php |
||
2 | /** |
||
3 | * Module: WF-Links |
||
4 | * Version: v1.0.3 |
||
5 | * Release Date: 21 June 2005 |
||
6 | * Developer: John N |
||
7 | * Team: WF-Projects |
||
8 | * Licence: GNU |
||
9 | */ |
||
10 | |||
11 | use XoopsModules\Wflinks; |
||
12 | |||
13 | require_once __DIR__ . '/header.php'; |
||
14 | |||
15 | require XOOPS_ROOT_PATH . '/header.php'; |
||
16 | require XOOPS_ROOT_PATH . '/class/xoopsformloader.php'; |
||
17 | |||
18 | /** @var Wflinks\Helper $helper */ |
||
19 | $helper = Wflinks\Helper::getInstance(); |
||
20 | |||
21 | $mytree = new Wflinks\Tree($xoopsDB->prefix('wflinks_cat'), 'cid', 'pid'); |
||
22 | global $myts; |
||
23 | |||
24 | $cid = \Xmf\Request::getInt('cid', 0); |
||
25 | $lid = \Xmf\Request::getInt('lid', 0); |
||
26 | $cid = (int)$cid; |
||
27 | $lid = (int)$lid; |
||
28 | |||
29 | if (false === Wflinks\Utility::checkGroups($cid, 'WFLinkSubPerm')) { |
||
30 | redirect_header('index.php', 1, _MD_WFL_NOPERMISSIONTOPOST); |
||
31 | } |
||
32 | |||
33 | if (true === Wflinks\Utility::checkGroups($cid, 'WFLinkSubPerm')) { |
||
34 | if (\Xmf\Request::getInt('submit', 0)) { |
||
35 | if (false === Wflinks\Utility::checkGroups($cid, 'WFLinkSubPerm')) { |
||
36 | redirect_header('index.php', 1, _MD_WFL_NOPERMISSIONTOPOST); |
||
37 | } |
||
38 | |||
39 | $submitter = (is_object($xoopsUser) && !empty($xoopsUser)) ? $xoopsUser->getVar('uid') : 0; |
||
40 | $forumid = \Xmf\Request::getInt('forumid', 0); |
||
41 | $offline = \Xmf\Request::getInt('offline', 0); |
||
42 | $notifypub = \Xmf\Request::getInt('notifypub', 0); |
||
43 | $approve = \Xmf\Request::getInt('approve', 0); |
||
44 | $url = $myts->addSlashes(ltrim($_POST['url'])); |
||
45 | $title = $myts->addSlashes(ltrim($_REQUEST['title'])); |
||
46 | $descriptionb = $myts->addSlashes(ltrim($_REQUEST['descriptionb'])); |
||
47 | $keywords = $myts->addSlashes(trim(mb_substr($_POST['keywords'], 0, $helper->getConfig('keywordlength')))); |
||
48 | |||
49 | $item_tag = ''; |
||
50 | if ($helper->getConfig('usercantag')) { |
||
51 | $item_tag = $myts->addSlashes(ltrim($_REQUEST['item_tag'])); |
||
52 | } |
||
53 | |||
54 | if ($helper->getConfig('useaddress')) { |
||
55 | $googlemap = ('http://maps.google.com' !== $_POST['googlemap']) ? $myts->addSlashes($_POST['googlemap']) : ''; |
||
56 | $yahoomap = ('http://maps.yahoo.com' !== $_POST['yahoomap']) ? $myts->addSlashes($_POST['yahoomap']) : ''; |
||
57 | $multimap = ('http://www.multimap.com' !== $_POST['multimap']) ? $myts->addSlashes($_POST['multimap']) : ''; |
||
58 | $street1 = $myts->addSlashes(ltrim($_REQUEST['street1'])); |
||
59 | $street2 = $myts->addSlashes(ltrim($_REQUEST['street2'])); |
||
60 | $town = $myts->addSlashes(ltrim($_REQUEST['town'])); |
||
61 | $state = $myts->addSlashes(ltrim($_REQUEST['state'])); |
||
62 | $zip = $myts->addSlashes(ltrim($_REQUEST['zip'])); |
||
63 | $tel = $myts->addSlashes(ltrim($_REQUEST['tel'])); |
||
64 | $fax = $myts->addSlashes(ltrim($_REQUEST['fax'])); |
||
65 | $voip = $myts->addSlashes(ltrim($_REQUEST['voip'])); |
||
66 | $mobile = $myts->addSlashes(ltrim($_REQUEST['mobile'])); |
||
67 | $email = Wflinks\Utility::convertEmail($myts->addSlashes(ltrim($_REQUEST['email']))); |
||
68 | $vat = $myts->addSlashes(ltrim($_REQUEST['vat'])); |
||
69 | } else { |
||
70 | $googlemap = $yahoomap = $multimap = $street1 = $street2 = $town = $state = $zip = $tel = $fax = $voip = $mobile = $email = $vat = ''; |
||
71 | } |
||
72 | |||
73 | $country = $myts->addSlashes(ltrim($_REQUEST['country'])); |
||
74 | |||
75 | $date = time(); |
||
76 | $publishdate = 0; |
||
77 | $ipaddress = $_SERVER['REMOTE_ADDR']; |
||
78 | |||
79 | if (0 == $lid) { |
||
80 | $status = 0; |
||
81 | $publishdate = 0; |
||
82 | $message = _MD_WFL_THANKSFORINFO; |
||
83 | if (true === Wflinks\Utility::checkGroups($cid, 'WFLinkAutoApp')) { |
||
84 | $publishdate = time(); |
||
85 | $status = 1; |
||
86 | $message = _MD_WFL_ISAPPROVED; |
||
87 | } |
||
88 | |||
89 | $sql = 'INSERT INTO ' |
||
90 | . $xoopsDB->prefix('wflinks_links') |
||
91 | . ' (lid, cid, title, url, submitter, status, date, hits, rating, votes, comments, forumid, published, expired, offline, description, ipaddress, notifypub, country, keywords, item_tag, googlemap, yahoomap, multimap, street1, street2, town, state, zip, tel, fax, voip, mobile, email, vat ) '; |
||
92 | |||
93 | $sql .= " VALUES (0, $cid, '$title', '$url', '$submitter', '$status', '$date', 0, 0, 0, 0, '$forumid', '$publishdate', 0, '$offline', '$descriptionb', '$ipaddress', '$notifypub', '$country', '$keywords', '$item_tag', '$googlemap', '$yahoomap', '$multimap', '$street1', '$street2', '$town', '$state', '$zip', '$tel', '$fax', '$voip', '$mobile', '$email', '$vat' )"; |
||
94 | |||
95 | if (!$result = $xoopsDB->query($sql)) { |
||
96 | $_error = $xoopsDB->error() . ' : ' . $xoopsDB->errno(); |
||
97 | /** @var \XoopsLogger $logger */ |
||
98 | $logger = \XoopsLogger::getInstance(); |
||
99 | $logger->handleError(E_USER_WARNING, $_error, __FILE__, __LINE__); |
||
100 | } |
||
101 | // $newid = $xoopsDB -> getInsertId(); |
||
102 | $newid = $GLOBALS['xoopsDB']->getInsertId(); |
||
103 | |||
104 | // Add item_tag to Tag-module |
||
105 | if (0 == $lid) { |
||
106 | $tagupdate = Wflinks\Utility::updateTag($newid, $item_tag); |
||
107 | } else { |
||
108 | $tagupdate = Wflinks\Utility::updateTag($lid, $item_tag); |
||
109 | } |
||
110 | |||
111 | // Notify of new link (anywhere) and new link in category |
||
112 | /** @var \XoopsNotificationHandler $notificationHandler */ |
||
113 | $notificationHandler = xoops_getHandler('notification'); |
||
114 | |||
115 | $tags = []; |
||
116 | $tags['LINK_NAME'] = $title; |
||
117 | $tags['LINK_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlelink.php?cid=' . $cid . '&lid=' . (int)$newid; |
||
118 | |||
119 | $sql = 'SELECT title FROM ' . $xoopsDB->prefix('wflinks_cat') . ' WHERE cid=' . $cid; |
||
120 | $result = $xoopsDB->query($sql); |
||
121 | $row = $xoopsDB->fetchArray($result); |
||
122 | |||
123 | $tags['CATEGORY_NAME'] = $row['title']; |
||
124 | $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid; |
||
125 | if (true === Wflinks\Utility::checkGroups($cid, 'WFLinkAutoApp')) { |
||
126 | $notificationHandler->triggerEvent('global', 0, 'new_link', $tags); |
||
127 | $notificationHandler->triggerEvent('category', $cid, 'new_link', $tags); |
||
128 | redirect_header('index.php', 2, _MD_WFL_ISAPPROVED); |
||
129 | } else { |
||
130 | $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/newlinks.php'; |
||
131 | $notificationHandler->triggerEvent('global', 0, 'link_submit', $tags); |
||
132 | $notificationHandler->triggerEvent('category', $cid, 'link_submit', $tags); |
||
133 | if ($notifypub) { |
||
134 | require_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
||
135 | $notificationHandler->subscribe('link', $newid, 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
||
136 | } |
||
137 | redirect_header('index.php', 2, _MD_WFL_THANKSFORINFO); |
||
138 | } |
||
139 | } else { |
||
140 | if (1 == $approve || true === Wflinks\Utility::checkGroups($cid, 'WFLinkAutoApp')) { |
||
141 | $updated = time(); |
||
142 | $sql = 'UPDATE ' |
||
143 | . $xoopsDB->prefix('wflinks_links') |
||
144 | . " SET cid=$cid, title='$title', url='$url', updated='$updated', offline='$offline', description='$descriptionb', ipaddress='$ipaddress', notifypub='$notifypub', country='$country', keywords='$keywords', item_tag='$item_tag', googlemap='$googlemap', yahoomap='$yahoomap', multimap='$multimap', street1='$street1', street2='$street2', town='$town', state='$state', zip='$zip', tel='$tel', fax='$fax', voip='$voip', mobile='$mobile', email='$email', vat='$vat' WHERE lid=" |
||
145 | . $lid; |
||
146 | if (!$result = $xoopsDB->query($sql)) { |
||
147 | $_error = $xoopsDB->error() . ' : ' . $xoopsDB->errno(); |
||
148 | /** @var \XoopsLogger $logger */ |
||
149 | $logger = \XoopsLogger::getInstance(); |
||
150 | $logger->handleError(E_USER_WARNING, $_error, __FILE__, __LINE__); |
||
151 | } |
||
152 | |||
153 | $notificationHandler = xoops_getHandler('notification'); |
||
154 | $tags = []; |
||
155 | $tags['LINK_NAME'] = $title; |
||
156 | $tags['LINK_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlelink.php?cid=' . $cid . '&lid=' . $lid; |
||
157 | $sql = 'SELECT title FROM ' . $xoopsDB->prefix('wflinks_cat') . ' WHERE cid=' . $cid; |
||
158 | $result = $xoopsDB->query($sql); |
||
159 | $row = $xoopsDB->fetchArray($result); |
||
160 | $tags['CATEGORY_NAME'] = $row['title']; |
||
161 | $tags['CATEGORY_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $lid; |
||
162 | |||
163 | $notificationHandler->triggerEvent('global', 0, 'new_link', $tags); |
||
164 | $notificationHandler->triggerEvent('category', $cid, 'new_link', $tags); |
||
165 | $_message = _MD_WFL_ISAPPROVED; |
||
166 | } else { |
||
167 | $modifysubmitter = $xoopsUser->uid(); |
||
168 | $requestid = $modifysubmitter; |
||
169 | $requestdate = time(); |
||
170 | $updated = \Xmf\Request::getInt('up_dated', time()); |
||
171 | $sql = 'INSERT INTO ' |
||
172 | . $xoopsDB->prefix('wflinks_mod') |
||
173 | . ' (requestid, lid, cid, title, url, forumid, description, modifysubmitter, requestdate, country, keywords, item_tag, googlemap, yahoomap, multimap, street1, street2, town, state, zip, tel, fax, voip, mobile, email, vat)'; |
||
174 | $sql .= " VALUES (0, $lid, $cid, '$title', '$url', '$forumid', '$descriptionb', '$modifysubmitter', '$requestdate', '$country', '$keywords', '$item_tag', '$googlemap', '$yahoomap', '$multimap', '$street1', '$street2', '$town', '$state', '$zip', '$tel', '$fax', '$voip', '$mobile', '$email', '$vat')"; |
||
175 | if (!$result = $xoopsDB->query($sql)) { |
||
176 | $_error = $xoopsDB->error() . ' : ' . $xoopsDB->errno(); |
||
177 | /** @var \XoopsLogger $logger */ |
||
178 | $logger = \XoopsLogger::getInstance(); |
||
179 | $logger->handleError(E_USER_WARNING, $_error, __FILE__, __LINE__); |
||
180 | } |
||
181 | |||
182 | $tags = []; |
||
183 | $tags['MODIFYREPORTS_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/main.php?op=listModReq'; |
||
184 | $notificationHandler = xoops_getHandler('notification'); |
||
185 | $notificationHandler->triggerEvent('global', 0, 'link_modify', $tags); |
||
186 | |||
187 | $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/main.php?op=listNewlinks'; |
||
188 | $notificationHandler->triggerEvent('global', 0, 'link_submit', $tags); |
||
189 | $notificationHandler->triggerEvent('category', $cid, 'link_submit', $tags); |
||
190 | if ($notifypub) { |
||
191 | require_once XOOPS_ROOT_PATH . '/include/notification_constants.php'; |
||
192 | $notificationHandler->subscribe('link', $newid, 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE); |
||
193 | } |
||
194 | $_message = _MD_WFL_THANKSFORINFO; |
||
195 | } |
||
196 | redirect_header('index.php', 2, $_message); |
||
197 | } |
||
198 | } else { |
||
199 | /** @var Wflinks\Helper $helper */ |
||
200 | $helper = Wflinks\Helper::getInstance(); |
||
201 | |||
202 | $approve = \Xmf\Request::getInt('approve', 0); |
||
203 | |||
204 | //Show disclaimer |
||
205 | if (!isset($_GET['agree']) && $helper->getConfig('showdisclaimer') && 0 == $approve) { |
||
206 | $GLOBALS['xoopsOption']['template_main'] = 'wflinks_disclaimer.tpl'; |
||
207 | require XOOPS_ROOT_PATH . '/header.php'; |
||
208 | |||
209 | $xoopsTpl->assign('image_header', Wflinks\Utility::getImageHeader()); |
||
210 | $xoopsTpl->assign('disclaimer', $myts->displayTarea($helper->getConfig('disclaimer'), 1, 1, 1, 1, 1)); |
||
211 | $xoopsTpl->assign('cancel_location', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/index.php'); |
||
212 | $xoopsTpl->assign('link_disclaimer', false); |
||
213 | if (!isset($_REQUEST['lid'])) { |
||
214 | $xoopsTpl->assign('agree_location', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?agree=1'); |
||
215 | } elseif (\Xmf\Request::hasVar('lid', 'REQUEST')) { |
||
216 | $lid = \Xmf\Request::getInt('lid', 0, 'REQUEST'); |
||
217 | $xoopsTpl->assign('agree_location', XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?agree=1&lid=' . $lid); |
||
218 | } |
||
219 | require XOOPS_ROOT_PATH . '/footer.php'; |
||
220 | exit(); |
||
221 | } |
||
222 | |||
223 | echo "<br><div class='txtcenter;'>" . Wflinks\Utility::getImageHeader() . "</div><br>\n"; |
||
224 | echo '<div>' . _MD_WFL_SUB_SNEWMNAMEDESC . "</div>\n<br>\n"; |
||
225 | |||
226 | $sql = 'SELECT * FROM ' . $xoopsDB->prefix('wflinks_links') . ' WHERE lid=' . $lid; |
||
227 | $link_array = $xoopsDB->fetchArray($xoopsDB->query($sql)); |
||
228 | |||
229 | $lid = $link_array['lid'] ?: 0; |
||
230 | $cid = $link_array['cid'] ?: 0; |
||
231 | $title = $link_array['title'] ? htmlspecialchars($link_array['title']) : ''; |
||
232 | $url = $link_array['url'] ? htmlspecialchars($link_array['url']) : 'http://'; |
||
233 | $publisher = $link_array['publisher'] ? htmlspecialchars($link_array['publisher']) : ''; |
||
234 | $screenshot = $link_array['screenshot'] ? htmlspecialchars($link_array['screenshot']) : ''; |
||
235 | $descriptionb = $link_array['description'] ? htmlspecialchars($link_array['description']) : ''; |
||
236 | $published = $link_array['published'] ?: 0; |
||
237 | $expired = $link_array['expired'] ?: 0; |
||
238 | $updated = $link_array['updated'] ?: 0; |
||
239 | $offline = $link_array['offline'] ?: 0; |
||
240 | $forumid = $link_array['forumid'] ?: 0; |
||
241 | $ipaddress = $link_array['ipaddress'] ?: 0; |
||
242 | $notifypub = $link_array['notifypub'] ?: 0; |
||
243 | $country = $link_array['country'] ? htmlspecialchars($link_array['country']) : '-'; |
||
244 | $keywords = $link_array['keywords'] ? htmlspecialchars($link_array['keywords']) : ''; |
||
245 | $item_tag = $link_array['item_tag'] ? htmlspecialchars($link_array['item_tag']) : ''; |
||
246 | |||
247 | $googlemap = $link_array['googlemap'] ? htmlspecialchars($link_array['googlemap']) : 'http://maps.google.com'; |
||
248 | $yahoomap = $link_array['yahoomap'] ? htmlspecialchars($link_array['yahoomap']) : 'http://maps.yahoo.com'; |
||
249 | $multimap = $link_array['multimap'] ? htmlspecialchars($link_array['multimap']) : 'http://www.multimap.com'; |
||
250 | |||
251 | $street1 = $link_array['street1'] ? htmlspecialchars($link_array['street1']) : ''; |
||
252 | $street2 = $link_array['street2'] ? htmlspecialchars($link_array['street2']) : ''; |
||
253 | $town = $link_array['town'] ? htmlspecialchars($link_array['town']) : ''; |
||
254 | $state = $link_array['state'] ? htmlspecialchars($link_array['state']) : ''; |
||
255 | $zip = $link_array['zip'] ? htmlspecialchars($link_array['zip']) : ''; |
||
256 | $tel = $link_array['tel'] ? htmlspecialchars($link_array['tel']) : ''; |
||
257 | $mobile = $link_array['mobile'] ? htmlspecialchars($link_array['mobile']) : ''; |
||
258 | $voip = $link_array['voip'] ? htmlspecialchars($link_array['voip']) : ''; |
||
259 | $fax = $link_array['fax'] ? htmlspecialchars($link_array['fax']) : ''; |
||
260 | $email = $link_array['email'] ? htmlspecialchars($link_array['email']) : ''; |
||
261 | $vat = $link_array['vat'] ? htmlspecialchars($link_array['vat']) : ''; |
||
262 | |||
263 | $sform = new \XoopsThemeForm(_MD_WFL_SUBMITCATHEAD, 'storyform', xoops_getenv('SCRIPT_NAME'), 'post', true); |
||
264 | $sform->setExtra('enctype="multipart/form-data"'); |
||
265 | |||
266 | // Title form |
||
267 | $sform->addElement(new \XoopsFormText(_MD_WFL_FILETITLE, 'title', 70, 255, $title), true); |
||
268 | |||
269 | // Link url form |
||
270 | $url_text = new \XoopsFormText('', 'url', 70, 255, $url); |
||
271 | $url_tray = new \XoopsFormElementTray(_MD_WFL_DLURL, ''); |
||
272 | $url_tray->addElement($url_text, true); |
||
273 | $url_tray->addElement(new \XoopsFormLabel(" <img src='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/assets/images/icon/world.png' onClick=\"window.open(document.storyform.url.value,'','');return(false);\" alt='Check URL'>")); |
||
274 | $sform->addElement($url_tray); |
||
275 | |||
276 | // Category selection menu |
||
277 | $mytree = new Wflinks\Tree($xoopsDB->prefix('wflinks_cat'), 'cid', 'pid'); |
||
278 | $submitcats = []; |
||
279 | $sql = 'SELECT * FROM ' . $xoopsDB->prefix('wflinks_cat') . ' ORDER BY title'; |
||
280 | $result = $xoopsDB->query($sql); |
||
281 | while (false !== ($myrow = $xoopsDB->fetchArray($result))) { |
||
282 | if (true === Wflinks\Utility::checkGroups($myrow['cid'], 'WFLinkSubPerm')) { |
||
283 | $submitcats[$myrow['cid']] = $myrow['title']; |
||
284 | } |
||
285 | } |
||
286 | ob_start(); |
||
287 | $mytree->makeMySelBox('title', 'title', $cid, 0); |
||
288 | $sform->addElement(new \XoopsFormLabel(_MD_WFL_CATEGORYC, ob_get_contents())); |
||
289 | ob_end_clean(); |
||
290 | |||
291 | // Link description form |
||
292 | // $editor = Wflinks\Utility::getWysiwygForm( _MD_WFL_DESCRIPTIONC, 'descriptionb', $descriptionb, 15, 60 ); |
||
293 | // $sform -> addElement($editor,false); |
||
294 | |||
295 | $optionsTrayNote = new \XoopsFormElementTray(_MD_WFL_DESCRIPTIONC, '<br>'); |
||
296 | if (class_exists('XoopsFormEditor')) { |
||
297 | $options['name'] = 'descriptionb'; |
||
298 | $options['value'] = $descriptionb; |
||
299 | $options['rows'] = 5; |
||
300 | $options['cols'] = '100%'; |
||
301 | $options['width'] = '100%'; |
||
302 | $options['height'] = '200px'; |
||
303 | $editor = new \XoopsFormEditor('', $helper->getConfig('form_optionsuser'), $options, $nohtml = false, $onfailure = 'textarea'); |
||
304 | $optionsTrayNote->addElement($editor); |
||
305 | } else { |
||
306 | $editor = new \XoopsFormDhtmlTextArea('', 'descriptionb', $item->getVar('descriptionb', 'e'), '100%', '100%'); |
||
307 | $optionsTrayNote->addElement($editor); |
||
308 | } |
||
309 | |||
310 | $sform->addElement($optionsTrayNote, false); |
||
311 | |||
312 | // Keywords form |
||
313 | $keywords = new \XoopsFormTextArea(_MD_WFL_KEYWORDS, 'keywords', $keywords, 7, 60, false); |
||
0 ignored issues
–
show
|
|||
314 | $keywords->setDescription('<small>' . _MD_WFL_KEYWORDS_NOTE . '</small>'); |
||
315 | $sform->addElement($keywords); |
||
316 | |||
317 | // Insert tags if Tag-module is installed and if user is allowed |
||
318 | if ($helper->getConfig('usercantag')) { |
||
319 | if (Wflinks\Utility::isTagModuleIncluded()) { |
||
320 | require_once XOOPS_ROOT_PATH . '/modules/tag/include/formtag.php'; |
||
321 | $text_tags = new \XoopsModules\Tag\FormTag('item_tag', 70, 255, $link_array['item_tag'], 0); |
||
322 | $sform->addElement($text_tags); |
||
323 | } else { |
||
324 | $sform->addElement(new \XoopsFormHidden('item_tag', $link_array['item_tag'])); |
||
325 | } |
||
326 | } |
||
327 | if ($helper->getConfig('useaddress')) { |
||
328 | $sform->insertBreak(_MD_WFL_LINK_CREATEADDRESS, 'even'); |
||
329 | // Google Maps |
||
330 | $googlemap_text = new \XoopsFormText('', 'googlemap', 70, 1024, $googlemap); |
||
331 | $googlemap_tray = new \XoopsFormElementTray(_MD_WFL_LINK_GOOGLEMAP, ''); |
||
332 | $googlemap_tray->addElement($googlemap_text, false); |
||
333 | $googlemap_tray->addElement(new \XoopsFormLabel(" <img src='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/assets/images/icon/google_map.png' onClick=\"window.open(document.storyform.googlemap.value,'','');return(false);\" alt='" . _MD_WFL_LINK_CHECKMAP . "'>")); |
||
334 | $sform->addElement($googlemap_tray); |
||
335 | |||
336 | // Yahoo Maps |
||
337 | $yahoomap_text = new \XoopsFormText('', 'yahoomap', 70, 1024, $yahoomap); |
||
338 | $yahoomap_tray = new \XoopsFormElementTray(_MD_WFL_LINK_YAHOOMAP, ''); |
||
339 | $yahoomap_tray->addElement($yahoomap_text, false); |
||
340 | $yahoomap_tray->addElement(new \XoopsFormLabel(" <img src='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/assets/images/icon/yahoo_map.png' onClick=\"window.open(document.storyform.yahoomap.value,'','');return(false);\" alt='" . _MD_WFL_LINK_CHECKMAP . "'>")); |
||
341 | $sform->addElement($yahoomap_tray); |
||
342 | |||
343 | // Multimap |
||
344 | $multimap_text = new \XoopsFormText('', 'multimap', 70, 1024, $multimap); |
||
345 | $multimap_tray = new \XoopsFormElementTray(_MD_WFL_LINK_MULTIMAP, ''); |
||
346 | $multimap_tray->addElement($multimap_text, false); |
||
347 | $multimap_tray->addElement(new \XoopsFormLabel(" <img src='" . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . "/assets/images/icon/multimap.png' onClick=\"window.open(document.storyform.multimap.value,'','');return(false);\" alt='" . _MD_WFL_LINK_CHECKMAP . "'>")); |
||
348 | $sform->addElement($multimap_tray); |
||
349 | |||
350 | // Address forms |
||
351 | $street1 = new \XoopsFormText(_MD_WFL_STREET1, 'street1', 70, 255, $street1); |
||
352 | $sform->addElement($street1, false); |
||
353 | $street2 = new \XoopsFormText(_MD_WFL_STREET2, 'street2', 70, 255, $street2); |
||
354 | $sform->addElement($street2, false); |
||
355 | $town = new \XoopsFormText(_MD_WFL_TOWN, 'town', 70, 255, $town); |
||
356 | $sform->addElement($town, false); |
||
357 | $state = new \XoopsFormText(_MD_WFL_STATE, 'state', 70, 255, $state); |
||
358 | $sform->addElement($state, false); |
||
359 | $zip = new \XoopsFormText(_MD_WFL_ZIPCODE, 'zip', 25, 25, $zip); |
||
360 | $sform->addElement($zip, false); |
||
361 | $tel = new \XoopsFormText(_MD_WFL_TELEPHONE, 'tel', 25, 25, $tel); |
||
362 | $sform->addElement($tel, false); |
||
363 | $mobile = new \XoopsFormText(_MD_WFL_MOBILE, 'mobile', 25, 25, $mobile); |
||
364 | $sform->addElement($mobile, false); |
||
365 | $voip = new \XoopsFormText(_MD_WFL_VOIP, 'voip', 25, 25, $voip); |
||
366 | $sform->addElement($voip, false); |
||
367 | $fax = new \XoopsFormText(_MD_WFL_FAX, 'fax', 25, 25, $fax); |
||
368 | $sform->addElement($fax, false); |
||
369 | $email = new \XoopsFormText(_MD_WFL_EMAIL, 'email', 25, 25, $email); |
||
370 | $sform->addElement($email, false); |
||
371 | $vat = new \XoopsFormText(_MD_WFL_VAT, 'vat', 25, 25, $vat); |
||
372 | $vat->setDescription(_MD_WFL_VATWIKI); |
||
373 | $sform->addElement($vat, false); |
||
374 | // $sform -> addElement( new \XoopsFormHidden( 'vat', $link_array['vat'] ) ); /* If you don't want to use the VAT form, */ |
||
375 | /* use this line and comment-out the 3 lines above */ |
||
376 | } |
||
377 | |||
378 | // Country form |
||
379 | $sform->addElement(new \XoopsFormSelectCountry(_MD_WFL_COUNTRY, 'country', $country), false); |
||
380 | |||
381 | $option_tray = new \XoopsFormElementTray(_MD_WFL_OPTIONS, '<br>'); |
||
382 | if (!$approve) { |
||
383 | $notify_checkbox = new \XoopsFormCheckBox('', 'notifypub'); |
||
384 | $notify_checkbox->addOption(1, _MD_WFL_NOTIFYAPPROVE); |
||
385 | $option_tray->addElement($notify_checkbox); |
||
386 | } else { |
||
387 | $sform->addElement(new \XoopsFormHidden('notifypub', 0)); |
||
388 | } |
||
389 | if ($lid > 0 && true === Wflinks\Utility::checkGroups($cid, 'WFLinkAppPerm')) { |
||
390 | $approve_checkbox = new \XoopsFormCheckBox('', 'approve', $approve); |
||
391 | $approve_checkbox->addOption(1, _MD_WFL_APPROVE); |
||
392 | $option_tray->addElement($approve_checkbox); |
||
393 | } elseif (true === Wflinks\Utility::checkGroups($cid, 'WFLinkAutoApp')) { |
||
394 | $sform->addElement(new \XoopsFormHidden('approve', 1)); |
||
395 | } else { |
||
396 | $sform->addElement(new \XoopsFormHidden('approve', 0)); |
||
397 | } |
||
398 | $sform->addElement($option_tray); |
||
399 | $buttonTray = new \XoopsFormElementTray('', ''); |
||
400 | $buttonTray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit')); |
||
401 | $buttonTray->addElement(new \XoopsFormHidden('lid', $lid)); |
||
402 | $sform->addElement($buttonTray); |
||
403 | $sform->display(); |
||
404 | require XOOPS_ROOT_PATH . '/footer.php'; |
||
405 | } |
||
406 | } else { |
||
407 | redirect_header('index.php', 2, _MD_WFL_NOPERMISSIONTOPOST); |
||
408 | } |
||
409 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.