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 | // $Id: modlink.php 11819 2013-07-09 18:21:40Z zyspec $ |
||
3 | // ------------------------------------------------------------------------ // |
||
4 | // XOOPS - PHP Content Management System // |
||
5 | // Copyright (c) 2000 XOOPS.org // |
||
6 | // <http://www.xoops.org/> // |
||
7 | // ------------------------------------------------------------------------ // |
||
8 | // This program is free software; you can redistribute it and/or modify // |
||
9 | // it under the terms of the GNU General Public License as published by // |
||
10 | // the Free Software Foundation; either version 2 of the License, or // |
||
11 | // (at your option) any later version. // |
||
12 | // // |
||
13 | // You may not change or alter any portion of this comment or credits // |
||
14 | // of supporting developers from this source code or any supporting // |
||
15 | // source code which is considered copyrighted (c) material of the // |
||
16 | // original comment or credit authors. // |
||
17 | // // |
||
18 | // This program is distributed in the hope that it will be useful, // |
||
19 | // but WITHOUT ANY WARRANTY; without even the implied warranty of // |
||
20 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // |
||
21 | // GNU General Public License for more details. // |
||
22 | // // |
||
23 | // You should have received a copy of the GNU General Public License // |
||
24 | // along with this program; if not, write to the Free Software // |
||
25 | // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // |
||
26 | // ------------------------------------------------------------------------ // |
||
27 | |||
28 | include __DIR__ . '/header.php'; |
||
29 | $myts = MyTextSanitizer::getInstance(); // MyTextSanitizer object |
||
30 | |||
31 | include_once __DIR__ . '/class/utility.php'; |
||
32 | //xoops_load('utility', $xoopsModule->getVar('dirname')); |
||
33 | |||
34 | if (!empty($_POST['submit'])) { |
||
35 | if (empty($xoopsUser)) { |
||
36 | redirect_header(XOOPS_URL . '/user.php', 2, _MD_MYLINKS_MUSTREGFIRST); |
||
37 | exit(); |
||
38 | } |
||
39 | $user = $xoopsUser->getVar('uid'); |
||
40 | $lid = MylinksUtility::mylinks_cleanVars($_POST, 'lid', 0, 'int', array('min' => 0)); |
||
41 | |||
42 | // include_once XOOPS_ROOT_PATH . '/class/module.errorhandler.php'; |
||
43 | // $eh = new ErrorHandler; //ErrorHandler object |
||
44 | |||
45 | $msg = ''; |
||
46 | switch (true) { |
||
47 | case ('' == $_POST['title']): |
||
48 | $msg .= _MD_MYLINKS_ERRORTITLE; |
||
49 | case ('' == $_POST['url']): |
||
50 | $msg .= _MD_MYLINKS_ERRORURL; |
||
51 | case ('' == $_POST['description']): |
||
52 | $msg .= _MD_MYLINKS_ERRORDESC; |
||
53 | } |
||
54 | if ('' !== $msg) { |
||
55 | MylinksUtility::show_message($msg); |
||
0 ignored issues
–
show
|
|||
56 | exit(); |
||
57 | } |
||
58 | |||
59 | $url = $myts->addSlashes($_POST['url']); |
||
60 | $logourl = $myts->addSlashes($_POST['logourl']); |
||
61 | $cid = MylinksUtility::mylinks_cleanVars($_POST, 'cid', 0, 'int', array('min' => 0)); |
||
62 | $title = $myts->addSlashes($_POST['title']); |
||
63 | $description = $myts->addSlashes($_POST['description']); |
||
64 | $newid = $xoopsDB->genId($xoopsDB->prefix('mylinks_mod') . '_requestid_seq'); |
||
65 | $sql = sprintf("INSERT INTO %s (requestid, lid, cid, title, url, logourl, description, modifysubmitter) VALUES (%u, %u, %u, '%s', '%s', '%s', '%s', %u)", $xoopsDB->prefix('mylinks_mod'), $newid, $lid, $cid, $title, $url, $logourl, $description, $user); |
||
66 | $result = $xoopsDB->query($sql); |
||
67 | if (!result) { |
||
68 | MylinksUtility::show_message(_MD_MYLINKS_DBNOTUPDATED); |
||
0 ignored issues
–
show
|
|||
69 | exit(); |
||
70 | } |
||
71 | $tags = array(); |
||
72 | $tags['MODIFYREPORTS_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=listModReq'; |
||
73 | $notificationHandler = xoops_getHandler('notification'); |
||
74 | $notificationHandler->triggerEvent('global', 0, 'link_modify', $tags); |
||
75 | redirect_header('index.php', 2, _MD_MYLINKS_THANKSFORINFO); |
||
76 | exit(); |
||
77 | } else { |
||
78 | if (empty($xoopsUser)) { |
||
79 | redirect_header(XOOPS_URL . '/user.php', 2, _MD_MYLINKS_MUSTREGFIRST); |
||
80 | exit(); |
||
81 | } |
||
82 | $lid = MylinksUtility::mylinks_cleanVars($_GET, 'lid', 0, 'int', array('min' => 0)); |
||
83 | |||
84 | include_once XOOPS_ROOT_PATH . '/class/tree.php'; |
||
85 | $mylinksCatHandler = xoops_getModuleHandler('category', $xoopsModule->getVar('dirname')); |
||
86 | $catObjs = $mylinksCatHandler->getAll(); |
||
87 | $myCatTree = new XoopsObjectTree($catObjs, 'cid', 'pid'); |
||
88 | |||
89 | $xoopsOption['template_main'] = 'mylinks_modlink.tpl'; |
||
90 | include XOOPS_ROOT_PATH . '/header.php'; |
||
91 | |||
92 | //wanikoo |
||
93 | $xoTheme->addStylesheet('browse.php?' . mylinksGetStylePath('mylinks.css', 'include')); |
||
94 | $xoTheme->addScript('browse.php?Frameworks/jquery/jquery.js'); |
||
95 | $xoTheme->addScript('browse.php?' . mylinksGetStylePath('mylinks.js', 'include')); |
||
96 | /* |
||
97 | $mylinks_module_header = "" |
||
98 | ."<link rel='stylesheet' type='text/css' href='" . mylinksGetStyleURL('mylinks.css') . "'>" |
||
99 | ."<script src='" . mylinksGetStyleURL('mylinks.js') . "' type='text/javascript'></script>"; |
||
100 | $xoopsTpl->assign('xoops_module_header', $mylinks_module_header); |
||
101 | */ |
||
102 | // |
||
103 | |||
104 | $result = $xoopsDB->query('SELECT l.lid, l.cid, l.title, l.url, l.logourl, l.status, l.date, l.hits, l.rating, l.votes, l.comments, t.description FROM ' . $xoopsDB->prefix('mylinks_links') . ' l, ' . $xoopsDB->prefix('mylinks_text') . " t WHERE l.lid={$lid} AND l.lid=t.lid AND status>0"); |
||
105 | list($lid, $cid, $title, $url, $logourl, $status, $time, $hits, $rating, $votes, $comments, $description) = $xoopsDB->fetchRow($result); |
||
106 | View Code Duplication | if ($xoopsUser && $xoopsUser->isAdmin($xoopsModule->mid())) { |
|
107 | $adminlink = "<a href='" . XOOPSMYLINKURL . "/admin/index.php?op=modLink&lid={$lid}'><img src='" . mylinksGetIconURL('edit.png') . "' style='border-width: 0px;' alt='" . _MD_MYLINKS_EDITTHISLINK . "'></a>"; |
||
108 | } else { |
||
109 | $adminlink = ''; |
||
110 | } |
||
111 | $votestring = (1 == $votes) ? _MD_MYLINKS_ONEVOTE : sprintf(_MD_MYLINKS_NUMVOTES, $votes); |
||
112 | |||
113 | $xoopsTpl->assign('link', array( |
||
114 | 'id' => $lid, |
||
115 | 'rating' => number_format($rating, 2), |
||
116 | 'title' => $myts->htmlSpecialChars($myts->stripSlashesGPC($title)), |
||
117 | 'url' => $myts->htmlSpecialChars($url), |
||
118 | 'logourl' => $myts->htmlSpecialChars($logourl), |
||
119 | 'updated' => formatTimestamp($time, 'm'), |
||
120 | 'description' => $myts->htmlSpecialChars($myts->stripSlashesGPC($description)), |
||
121 | 'adminlink' => $adminlink, |
||
122 | 'hits' => $hits, |
||
123 | 'votes' => $votestring |
||
124 | )); |
||
125 | $xoopsTpl->assign('lang_requestmod', _MD_MYLINKS_REQUESTMOD); |
||
126 | $xoopsTpl->assign('lang_linkid', _MD_MYLINKS_LINKID); |
||
127 | $xoopsTpl->assign('lang_sitetitle', _MD_MYLINKS_SITETITLE); |
||
128 | $xoopsTpl->assign('lang_siteurl', _MD_MYLINKS_SITEURL); |
||
129 | $xoopsTpl->assign('lang_category', _MD_MYLINKS_CATEGORYC); |
||
130 | $xoopsTpl->assign('category_selbox', $myCatTree->makeSelBox('cid', 'title', '-', $cid)); |
||
131 | $xoopsTpl->assign('lang_description', _MD_MYLINKS_DESCRIPTIONC); |
||
132 | $xoopsTpl->assign('lang_sendrequest', _MD_MYLINKS_SENDREQUEST); |
||
133 | $xoopsTpl->assign('lang_cancel', _CANCEL); |
||
134 | //wanikoo theme changer |
||
135 | $xoopsTpl->assign('lang_themechanger', _MD_MYLINKS_THEMECHANGER); |
||
136 | $mymylinkstheme_options = ''; |
||
137 | |||
138 | View Code Duplication | foreach ($GLOBALS['mylinks_allowed_theme'] as $mymylinkstheme) { |
|
139 | $mymylinkstheme_options .= "<option value='{$mymylinkstheme}'"; |
||
140 | if ($mymylinkstheme == $GLOBALS['mylinks_theme']) { |
||
141 | $mymylinkstheme_options .= " selected='selected'"; |
||
142 | } |
||
143 | $mymylinkstheme_options .= ">{$mymylinkstheme}</option>"; |
||
144 | } |
||
145 | |||
146 | $mylinkstheme_select = "<select name='mylinks_theme_select' onchange='submit();' size='1'>{$mymylinkstheme_options}</select>"; |
||
147 | |||
148 | $xoopsTpl->assign('mylinksthemeoption', $mylinkstheme_select); |
||
149 | |||
150 | //wanikoo search |
||
151 | View Code Duplication | if (file_exists(XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/search.php')) { |
|
152 | include_once XOOPS_ROOT_PATH . '/language/' . $xoopsConfig['language'] . '/search.php'; |
||
153 | } else { |
||
154 | include_once XOOPS_ROOT_PATH . '/language/english/search.php'; |
||
155 | } |
||
156 | $xoopsTpl->assign('lang_all', _SR_ALL); |
||
157 | $xoopsTpl->assign('lang_any', _SR_ANY); |
||
158 | $xoopsTpl->assign('lang_exact', _SR_EXACT); |
||
159 | $xoopsTpl->assign('lang_search', _SR_SEARCH); |
||
160 | $xoopsTpl->assign('module_id', $xoopsModule->getVar('mid')); |
||
161 | //category head |
||
162 | $catarray = array(); |
||
163 | if ($mylinks_show_letters) { |
||
164 | $catarray['letters'] = ml_wfd_letters(); |
||
165 | } |
||
166 | if ($mylinks_show_toolbar) { |
||
167 | $catarray['toolbar'] = ml_wfd_toolbar(); |
||
168 | } |
||
169 | $xoopsTpl->assign('catarray', $catarray); |
||
170 | |||
171 | include_once XOOPSMYLINKPATH . '/footer.php'; |
||
172 | } |
||
173 |
This method has been deprecated.