mambax7 /
publisher
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 declare(strict_types=1); |
||
| 2 | /* |
||
| 3 | You may not change or alter any portion of this comment or credits |
||
| 4 | of supporting developers from this source code or any supporting source code |
||
| 5 | which is considered copyrighted (c) material of the original comment or credit authors. |
||
| 6 | |||
| 7 | This program is distributed in the hope that it will be useful, |
||
| 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
| 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
| 10 | */ |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Publisher class |
||
| 14 | * |
||
| 15 | * @copyright XOOPS Project (https://xoops.org) |
||
| 16 | * @license https://www.fsf.org/copyleft/gpl.html GNU public license |
||
| 17 | * @since 1.0 |
||
| 18 | * @author trabis <[email protected]> |
||
| 19 | */ |
||
| 20 | |||
| 21 | use Xmf\Module\Admin; |
||
| 22 | use XoopsModules\Publisher\{ |
||
| 23 | Common\Configurator, |
||
| 24 | Helper, |
||
| 25 | Utility |
||
| 26 | }; |
||
| 27 | |||
| 28 | /** @var Helper $helper */ |
||
| 29 | /** @var Utility $utility */ |
||
| 30 | $moduleDirName = \basename(\dirname(__DIR__)); |
||
| 31 | $moduleDirNameUpper = \mb_strtoupper($moduleDirName); |
||
| 32 | |||
| 33 | require \dirname(__DIR__) . '/preloads/autoloader.php'; |
||
| 34 | |||
| 35 | /** @var \XoopsMySQLDatabase $db */ |
||
| 36 | $db = \XoopsDatabaseFactory::getDatabaseConnection(); |
||
| 37 | $helper = Helper::getInstance(); |
||
| 38 | $utility = new Utility(); |
||
| 39 | |||
| 40 | $helper->loadLanguage('common'); |
||
| 41 | |||
| 42 | $configurator = new Configurator(); |
||
| 43 | $icons = $configurator->icons; |
||
| 44 | |||
| 45 | //$utilities = new Publisher\Utilities(); |
||
| 46 | //$brokenHandler = new Publisher\BrokenHandler($db); |
||
| 47 | //$categoryHandler = new Publisher\CategoryHandler($db); |
||
| 48 | //$downlimitHandler = new Publisher\DownlimitHandler($db); |
||
| 49 | //$downloadsHandler = new Publisher\DownloadsHandler($db); |
||
| 50 | //$fielddataHandler = new Publisher\FielddataHandler($db); |
||
| 51 | //$fieldHandler = new Publisher\FieldHandler($db); |
||
| 52 | //$modifiedfielddataHandler = new Publisher\ModifiedfielddataHandler($db); |
||
| 53 | //$modifiedHandler = new Publisher\ModifiedHandler($db); |
||
| 54 | //$ratingHandler = new Publisher\RatingHandler($db); |
||
| 55 | |||
| 56 | if (!defined($moduleDirNameUpper . '_CONSTANTS_DEFINED')) { |
||
| 57 | define($moduleDirNameUpper . '_DIRNAME', basename(dirname(__DIR__))); |
||
| 58 | define($moduleDirNameUpper . '_ROOT_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName); |
||
| 59 | define($moduleDirNameUpper . '_PATH', XOOPS_ROOT_PATH . '/modules/' . $moduleDirName); |
||
| 60 | define($moduleDirNameUpper . '_URL', XOOPS_URL . '/modules/' . $moduleDirName); |
||
| 61 | define($moduleDirNameUpper . '_IMAGES_URL', constant($moduleDirNameUpper . '_URL') . '/assets/images'); |
||
| 62 | define($moduleDirNameUpper . '_IMAGES_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/assets/images'); |
||
| 63 | define($moduleDirNameUpper . '_ADMIN_URL', constant($moduleDirNameUpper . '_URL') . '/admin'); |
||
| 64 | define($moduleDirNameUpper . '_ADMIN_PATH', constant($moduleDirNameUpper . '_ROOT_PATH') . '/admin/'); |
||
| 65 | define($moduleDirNameUpper . '_ADMIN', constant($moduleDirNameUpper . '_URL') . '/admin/index.php'); |
||
| 66 | define($moduleDirNameUpper . '_AUTHOR_LOGOIMG', constant($moduleDirNameUpper . '_URL') . '/assets/images/logoModule.png'); |
||
| 67 | define($moduleDirNameUpper . '_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirName); // WITHOUT Trailing slash |
||
| 68 | define($moduleDirNameUpper . '_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName); // WITHOUT Trailing slash |
||
| 69 | define($moduleDirNameUpper . '_CAT_IMAGES_URL', XOOPS_UPLOAD_URL . ' / ' . constant($moduleDirNameUpper . '_DIRNAME') . '/images/category'); |
||
| 70 | define($moduleDirNameUpper . '_CAT_IMAGES_PATH', XOOPS_UPLOAD_PATH . '/' . constant($moduleDirNameUpper . '_DIRNAME') . ' / images / category'); |
||
| 71 | define($moduleDirNameUpper . '_CACHE_PATH', XOOPS_UPLOAD_PATH . '/' . $moduleDirName . '/'); |
||
| 72 | define($moduleDirNameUpper . '_CONSTANTS_DEFINED', 1); |
||
| 73 | } |
||
| 74 | |||
| 75 | //if (!defined('PUBLISHER_DIRNAME')) { |
||
| 76 | // define('PUBLISHER_DIRNAME', basename(dirname(__DIR__))); |
||
| 77 | // define('PUBLISHER_URL', XOOPS_URL . '/modules/' . PUBLISHER_DIRNAME); |
||
| 78 | // define('PUBLISHER_PATH', XOOPS_ROOT_PATH . '/modules/' . PUBLISHER_DIRNAME); |
||
| 79 | // define('PUBLISHER_IMAGES_URL', PUBLISHER_URL . '/assets/images'); |
||
| 80 | // define('PUBLISHER_ADMIN_URL', PUBLISHER_URL . '/admin'); |
||
| 81 | // define('PUBLISHER_ADMIN_PATH', PUBLISHER_PATH . '/admin/index.php'); |
||
| 82 | // define('PUBLISHER_ROOT_PATH', $GLOBALS['xoops']->path('modules/' . PUBLISHER_DIRNAME)); |
||
| 83 | // define('PUBLISHER_AUTHOR_LOGOIMG', PUBLISHER_URL . '/assets/images/logo.png'); |
||
| 84 | // define('PUBLISHER_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . PUBLISHER_DIRNAME); // WITHOUT Trailing slash |
||
| 85 | // define('PUBLISHER_UPLOAD_PATH', XOOPS_UPLOAD_PATH . '/' . PUBLISHER_DIRNAME); // WITHOUT Trailing slash |
||
| 86 | //} |
||
| 87 | |||
| 88 | //require_once PUBLISHER_ROOT_PATH . '/include/functions.php'; |
||
| 89 | //require_once PUBLISHER_ROOT_PATH . '/include/constants.php'; |
||
| 90 | //require_once PUBLISHER_ROOT_PATH . '/include/seo_functions.php'; |
||
| 91 | //require_once PUBLISHER_ROOT_PATH . '/class/metagen.php'; |
||
| 92 | //require_once PUBLISHER_ROOT_PATH . '/class/session.php'; |
||
| 93 | //require_once PUBLISHER_ROOT_PATH . '/class/request.php'; |
||
| 94 | |||
| 95 | //xoops_load('Constants', PUBLISHER_DIRNAME); |
||
| 96 | |||
| 97 | //This is needed or it will not work in blocks. |
||
| 98 | global $publisherIsAdmin; |
||
| 99 | |||
| 100 | // Load only if module is installed |
||
| 101 | if (is_object($helper->getModule())) { |
||
| 102 | // Find if the user is admin of the module |
||
| 103 | $publisherIsAdmin = Utility::userIsAdmin(); |
||
| 104 | // get current page |
||
| 105 | $publisherCurrentPage = Utility::getCurrentPage(); |
||
| 106 | } |
||
| 107 | |||
| 108 | $pathIcon16 = Admin::iconUrl('', '16'); |
||
| 109 | $pathIcon32 = Admin::iconUrl('', '32'); |
||
| 110 | //$pathModIcon16 = $helper->getModule()->getInfo('modicons16'); |
||
| 111 | //$pathModIcon32 = $helper->getModule()->getInfo('modicons32'); |
||
| 112 | |||
| 113 | //$icons = [ |
||
| 114 | // 'edit' => "<img src='" . $pathIcon16 . "/edit.png' alt=" . _EDIT . "' align='middle'>", |
||
| 115 | // 'delete' => "<img src='" . $pathIcon16 . "/delete.png' alt='" . _DELETE . "' align='middle'>", |
||
| 116 | // 'clone' => "<img src='" . $pathIcon16 . "/editcopy.png' alt='" . _CLONE . "' align='middle'>", |
||
| 117 | // 'preview' => "<img src='" . $pathIcon16 . "/view.png' alt='" . _PREVIEW . "' align='middle'>", |
||
| 118 | // 'print' => "<img src='" . $pathIcon16 . "/printer.png' alt='" . _CLONE . "' align='middle'>", |
||
| 119 | // 'pdf' => "<img src='" . $pathIcon16 . "/pdf.png' alt='" . _CLONE . "' align='middle'>", |
||
| 120 | // 'add' => "<img src='" . $pathIcon16 . "/add.png' alt='" . _ADD . "' align='middle'>", |
||
| 121 | // '0' => "<img src='" . $pathIcon16 . "/0.png' alt='" . 0 . "' align='middle'>", |
||
| 122 | // '1' => "<img src='" . $pathIcon16 . "/1.png' alt='" . 1 . "' align='middle'>", |
||
| 123 | //]; |
||
| 124 | |||
| 125 | \define('PUBLISHER_ICONS_URL_16', \constant($moduleDirNameUpper . '_URL') . '/assets/icons/16'); |
||
| 126 | \define('PUBLISHER_ICONS_URL_24', \constant($moduleDirNameUpper . '_URL') . '/assets/icons/24'); |
||
| 127 | \define('PUBLISHER_ICONS_URL_32', \constant($moduleDirNameUpper . '_URL') . '/assets/icons/32'); |
||
| 128 | |||
| 129 | //\define('PUBLISHER_UPLOAD_URL', XOOPS_UPLOAD_URL . '/' . $moduleDirNameUpper); // WITHOUT Trailing slash |
||
| 130 | //\define('PUBLISHER_URL', XOOPS_URL . '/modules/' . $moduleDirNameUpper); |
||
| 131 | |||
| 132 | $debug = false; |
||
| 133 | |||
| 134 | // MyTextSanitizer object |
||
| 135 | $myts = \MyTextSanitizer::getInstance(); |
||
| 136 | |||
| 137 | if (!isset($GLOBALS['xoopsTpl']) || !($GLOBALS['xoopsTpl'] instanceof \XoopsTpl)) { |
||
| 138 | require_once $GLOBALS['xoops']->path('class/template.php'); |
||
| 139 | $GLOBALS['xoopsTpl'] = new \XoopsTpl(); |
||
| 140 | } |
||
| 141 | |||
| 142 | $GLOBALS['xoopsTpl']->assign('mod_url', $helper->url()); |
||
| 143 | // Local icons path |
||
| 144 | if (is_object($helper->getModule())) { |
||
| 145 | $pathModIcon16 = $helper->getModule() |
||
| 146 | ->getInfo('modicons16'); |
||
| 147 | $pathModIcon32 = $helper->getModule() |
||
| 148 | ->getInfo('modicons32'); |
||
| 149 | |||
| 150 | $GLOBALS['xoopsTpl']->assign('pathModIcon16', XOOPS_URL . '/modules/' . $moduleDirName . '/' . $pathModIcon16); |
||
| 151 | $GLOBALS['xoopsTpl']->assign('pathModIcon32', $pathModIcon32); |
||
| 152 | } |
||
| 153 | |||
| 154 | xoops_loadLanguage('main', $moduleDirName); |
||
| 155 | if (class_exists('D3LanguageManager')) { |
||
| 156 | require_once XOOPS_TRUST_PATH . '/libs/altsys/class/D3LanguageManager.class.php'; |
||
| 157 | $langman = D3LanguageManager::getInstance(); |
||
|
0 ignored issues
–
show
|
|||
| 158 | $langman->read('main.php', $moduleDirName); |
||
| 159 | } |
||
| 160 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths