 mambax7    /
                    wflinks
                      mambax7    /
                    wflinks
                
                            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 | $module_link = ''; | ||
| 14 | |||
| 15 | /** @var Wflinks\Helper $helper */ | ||
| 16 | $helper = Wflinks\Helper::getInstance(); | ||
| 17 | |||
| 18 | $link['id'] = (int)$link_arr['lid']; | ||
| 19 | $link['cid'] = (int)$link_arr['cid']; | ||
| 20 | $link['published'] = (int)$link_arr['published'] ? true : false; | ||
| 21 | |||
| 22 | $path = $mytree->getPathFromId($link_arr['cid'], 'title'); | ||
| 23 | $path = mb_substr($path, 1); | ||
| 24 | $path = basename($path); | ||
| 25 | $path             = str_replace('/', '', $path); | ||
| 26 | $link['category'] = $path; | ||
| 27 | |||
| 28 | $rating = round(number_format($link_arr['rating'], 0) / 2); | ||
| 29 | $link['rateimg'] = 'rate' . $rating . '.gif'; | ||
| 30 | unset($rating); | ||
| 31 | |||
| 32 | $link['votes'] = (1 == $link_arr['votes']) ? _MD_WFL_ONEVOTE : sprintf(_MD_WFL_NUMVOTES, $link_arr['votes']); | ||
| 33 | $link['hits'] = sprintf(_MD_WFL_LINKHITS, (int)$link_arr['hits']); | ||
| 34 | $xoopsTpl->assign('lang_dltimes', $link['hits']); | ||
| 35 | |||
| 36 | $link['title'] = $link_arr['title']; | ||
| 37 | $link['url'] = $link_arr['url']; | ||
| 38 | |||
| 39 | // Get Google Pagerank | ||
| 40 | if (null !== $helper->getConfig('showpagerank') && 1 == $helper->getConfig('showpagerank')) { | ||
| 41 | $link['pagerank'] = Wflinks\Utility::pagerank($link['url']); | ||
| 42 | } | ||
| 43 | |||
| 44 | if (isset($link_arr['screenshot'])) { | ||
| 45 | $link['screenshot_full'] = htmlspecialchars($link_arr['screenshot']); | ||
| 46 | if (!empty($link_arr['screenshot']) | ||
| 47 |         && file_exists(XOOPS_ROOT_PATH . '/' . $helper->getConfig('screenshots') . '/' . xoops_trim($link_arr['screenshot']))) { | ||
| 48 |         if (null !== $helper->getConfig('usethumbs') && 1 == $helper->getConfig('usethumbs')) { | ||
| 49 |             $_thumb_image = new Wflinks\ThumbsNails($link['screenshot_full'], $helper->getConfig('screenshots'), 'thumbs'); | ||
| 50 |             if ($_thumb_image) { | ||
| 0 ignored issues–
                            show     
    
    
        introduced 
                            by  
  Loading history... | |||
| 51 | $_thumb_image->setUseThumbs(1); | ||
| 52 |                 $_thumb_image->setImageType('gd2'); | ||
| 53 |                 $_image = $_thumb_image->createThumb($helper->getConfig('shotwidth'), $helper->getConfig('shotheight'), $helper->getConfig('imagequality'), $helper->getConfig('updatethumbs'), $helper->getConfig('keepaspect')); | ||
| 54 | } | ||
| 55 |             $link['screenshot_thumb'] = XOOPS_URL . "/{$helper->getConfig('screenshots')}/$_image"; | ||
| 56 |         } else { | ||
| 57 |             $link['screenshot_thumb'] = XOOPS_URL . "/{$helper->getConfig('screenshots')}/" . xoops_trim($link_arr['screenshot']); | ||
| 58 | } | ||
| 59 | } | ||
| 60 | } | ||
| 61 | |||
| 62 | if (0 == $moderate) { | ||
| 63 | $time = (0 != $link_arr['updated']) ? $link_arr['updated'] : $link_arr['published']; | ||
| 64 | $is_updated = (0 != $link_arr['updated']) ? _MD_WFL_UPDATEDON : _MD_WFL_PUBLISHDATE; | ||
| 65 |     $xoopsTpl->assign('lang_subdate', $is_updated); | ||
| 66 | } else { | ||
| 67 | $time = $link_arr['date']; | ||
| 68 | $is_updated = _MD_WFL_SUBMITDATE; | ||
| 69 |     $xoopsTpl->assign('lang_subdate', $is_updated); | ||
| 70 | } | ||
| 71 | |||
| 72 | $link['updated'] = formatTimestamp($time, $helper->getConfig('dateformat')); | ||
| 73 | $description = $myts->displayTarea($link_arr['description'], 1, 1, 1, 1, 1); | ||
| 74 | |||
| 75 | $link['description'] = xoops_substr($description, 0, $helper->getConfig('totalchars'), '...'); | ||
| 76 | xoops_load('XoopsUserUtility'); | ||
| 77 | $link['submitter'] = \XoopsUserUtility::getUnameFromId($link_arr['submitter']); | ||
| 78 | $link['publisher'] = (isset($link_arr['publisher']) | ||
| 79 | && !empty($link_arr['publisher'])) ? htmlspecialchars($link_arr['publisher']) : _MD_WFL_NOTSPECIFIED; | ||
| 80 | |||
| 81 | $country = $link_arr['country']; | ||
| 82 | $link['country']     = XOOPS_URL . '/' . $helper->getConfig('flagimage') . '/' . $country . '.gif'; | ||
| 83 | $link['countryname'] = Wflinks\Utility::getCountryName($link_arr['country']); | ||
| 84 | |||
| 85 | $mail_subject = rawurlencode(sprintf(_MD_WFL_INTFILEFOUND, $xoopsConfig['sitename'])); | ||
| 86 | $mail_body        = rawurlencode(sprintf(_MD_WFL_INTFILEFOUND, $xoopsConfig['sitename']) . ':  ' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlelink.php?cid=' . $link_arr['cid'] . '&lid=' . $link_arr['lid']); | ||
| 87 | $link['isadmin'] = ((is_object($xoopsUser) && !empty($xoopsUser)) | ||
| 88 | && $xoopsUser->isAdmin($xoopsModule->mid())); | ||
| 89 | $link['comments'] = $link_arr['comments']; | ||
| 90 | $whoisurl         = str_replace('http://', '', $link['url']); | ||
| 91 | |||
| 92 | $link['adminlink'] = ''; | ||
| 93 | if (0 == $moderate && true === $link['isadmin']) { | ||
| 94 | $link['adminlink'] = '<a href="' | ||
| 95 | . XOOPS_URL | ||
| 96 | . '/modules/' | ||
| 97 |                          . $xoopsModule->getVar('dirname') | ||
| 98 | . '/admin/index.php"><img src="' | ||
| 99 | . XOOPS_URL | ||
| 100 | . '/modules/' | ||
| 101 |                          . $xoopsModule->getVar('dirname') | ||
| 102 | . '/assets/images/icon/computer.png" alt="' | ||
| 103 | . _MD_WFL_ADMINSECTION | ||
| 104 | . '" title="' | ||
| 105 | . _MD_WFL_ADMINSECTION | ||
| 106 | . '" align="absmiddle"></a> '; | ||
| 107 | $link['adminlink'] .= '<a href="' | ||
| 108 | . XOOPS_URL | ||
| 109 | . '/modules/' | ||
| 110 |                           . $xoopsModule->getVar('dirname') | ||
| 111 | . '/admin/main.php?op=edit&lid=' | ||
| 112 | . $link_arr['lid'] | ||
| 113 | . '"><img src="' | ||
| 114 |                           . \Xmf\Module\Admin::iconUrl('', 16) | ||
| 115 | . '/edit.png" alt="' | ||
| 116 | . _MD_WFL_EDIT | ||
| 117 | . '" title="' | ||
| 118 | . _MD_WFL_EDIT | ||
| 119 | . '" align="absmiddle"></a> '; | ||
| 120 | $link['adminlink'] .= '<a href="' | ||
| 121 | . XOOPS_URL | ||
| 122 | . '/modules/' | ||
| 123 |                           . $xoopsModule->getVar('dirname') | ||
| 124 | . '/admin/main.php?op=delete&lid=' | ||
| 125 | . $link_arr['lid'] | ||
| 126 | . '"><img src="' | ||
| 127 |                           . \Xmf\Module\Admin::iconUrl('', 16) | ||
| 128 | . '/delete.png" alt="' | ||
| 129 | . _MD_WFL_DELETE | ||
| 130 | . '" title="' | ||
| 131 | . _MD_WFL_DELETE | ||
| 132 | . '" align="absmiddle"></a> '; | ||
| 133 |     $link['adminlink'] .= '<a href="http://whois.domaintools.com/' . $whoisurl . '" target="_blank"><img src="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/assets/images/icon/domaintools.png" alt="WHOIS" title="WHOIS" align="absmiddle"></a>'; | ||
| 134 | } else { | ||
| 135 |     $link['adminlink'] = '[ <a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?op=edit&lid=' . $link_arr['lid'] . '&approve=1">' . _MD_WFL_APPROVE . '</a> | '; | ||
| 136 |     $link['adminlink'] .= '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?op=delete&lid=' . $link_arr['lid'] . '">' . _MD_WFL_DELETE . '</a> ]'; | ||
| 137 | } | ||
| 138 | |||
| 139 | $votestring = (1 == $link_arr['votes']) ? _MD_WFL_ONEVOTE : sprintf(_MD_WFL_NUMVOTES, $link_arr['votes']); | ||
| 140 | |||
| 141 | $link['useradminlink'] = 0; | ||
| 142 | if (is_object($xoopsUser) && !empty($xoopsUser)) { | ||
| 143 |     $_user_submitter = $xoopsUser->getVar('uid') == $link_arr['submitter']; | ||
| 144 |     if (true === Wflinks\Utility::checkGroups($cid)) { | ||
| 145 | $link['useradminlink'] = 1; | ||
| 146 |         if ($xoopsUser->getVar('uid') == $link_arr['submitter']) { | ||
| 147 |             $link['usermodify'] = '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/submit.php?lid=' . $link_arr['lid'] . '"> ' . _MD_WFL_MODIFY . '</a> |'; | ||
| 148 | } | ||
| 149 | } | ||
| 150 | } | ||
| 151 | |||
| 152 | switch ($helper->getConfig('selectforum')) { | ||
| 153 | case '1': | ||
| 154 | $forum = 'newbb'; | ||
| 155 | $forum_path_prefix = '/modules/newbb/viewforum.php?forum='; | ||
| 156 | break; | ||
| 157 | case '2': | ||
| 158 | $forum = 'ipboard'; | ||
| 159 | $forum_path_prefix = '/modules/ipboard/index.php?showforum='; | ||
| 160 | break; | ||
| 161 | case '3': | ||
| 162 | $forum = 'pbboard'; | ||
| 163 | $forum_path_prefix = '/modules/pbboard/viewforum.php?f='; | ||
| 164 | break; | ||
| 165 | case '4': | ||
| 166 | $forum = 'newbbex'; | ||
| 167 | $forum_path_prefix = '/modules/newbbex/viewforum.php?forum='; | ||
| 168 | break; | ||
| 169 | } | ||
| 170 | $xoopsforumModule = $xoopsModule::getByDirname($forum); | ||
| 171 | if (is_object($xoopsforumModule) && $xoopsforumModule->getVar('isactive')) { | ||
| 172 | $link['forumid'] = ($link_arr['forumid'] > 0) ? $link_arr['forumid'] : 0; | ||
| 173 | $link['forum_path'] = $forum_path_prefix . (string)$link['forumid']; | ||
| 174 | } | ||
| 175 | |||
| 176 | $xoopsTpl->assign('ratethislink', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/ratelink.php?cid=' . $link_arr['cid'] . '&lid=' . $link_arr['lid'] . '">' . _MD_WFL_RATETHISFILE . '</a>'); | ||
| 177 | |||
| 178 | $xoopsTpl->assign('reportbroken', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/brokenlink.php?lid=' . $link_arr['lid'] . '">' . _MD_WFL_REPORTBROKEN . '</a>'); | ||
| 179 | |||
| 180 | $xoopsTpl->assign('mailto', '<a href="mailto:?subject=' . $mail_subject . '&body=' . $mail_body . '" target="_top">' . _MD_WFL_TELLAFRIEND . '</a>'); | ||
| 181 | |||
| 182 | $xoopsTpl->assign('commentz', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlelink.php?cid=' . $link_arr['cid'] . '&lid=' . $link_arr['lid'] . '">' . _COMMENTS . ' (' . $link_arr['comments'] . ')</a>'); | ||
| 183 | |||
| 184 | $xoopsTpl->assign('print', '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/print.php?lid=' . $link_arr['lid'] . '"  target="_blank">' . _MD_WFL_PRINT . '</a>'); | ||
| 185 | |||
| 186 | $link['icons'] = Wflinks\Utility::displayIcons($link_arr['published'], $link_arr['status'], $link_arr['hits']); | ||
| 187 | $link['allow_rating'] = Wflinks\Utility::checkGroups($cid, 'WFLinkRatePerms') ? true : false; | ||
| 188 | $link['total_chars']   = $helper->getConfig('totalchars'); | ||
| 189 | $link['module_dir']    = $xoopsModule->getVar('dirname'); | ||
| 190 | $link['otherlinx']     = $helper->getConfig('otherlinks'); | ||
| 191 | $link['showpagerank']  = $helper->getConfig('showpagerank'); | ||
| 192 | $link['quickview']     = $helper->getConfig('quickview'); | ||
| 193 | $link['comment_rules'] = $helper->getConfig('com_rule'); | ||
| 194 | $link['autoscrshot']   = $helper->getConfig('useautothumb'); | ||
| 195 | 
