mambax7 /
marquee
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 | * **************************************************************************** |
||||||
| 4 | * marquee - MODULE FOR XOOPS |
||||||
| 5 | * Copyright (c) Hervé Thouzard (https://www.herve-thouzard.com) |
||||||
| 6 | * |
||||||
| 7 | * You may not change or alter any portion of this comment or credits |
||||||
| 8 | * of supporting developers from this source code or any supporting source code |
||||||
| 9 | * which is considered copyrighted (c) material of the original comment or credit authors. |
||||||
| 10 | * This program is distributed in the hope that it will be useful, |
||||||
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||||||
| 13 | * |
||||||
| 14 | * @copyright Hervé Thouzard (https://www.herve-thouzard.com) |
||||||
| 15 | * @license GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html) |
||||||
| 16 | * @author Hervé Thouzard (https://www.herve-thouzard.com) |
||||||
| 17 | * |
||||||
| 18 | * Version : |
||||||
| 19 | * **************************************************************************** |
||||||
| 20 | * |
||||||
| 21 | * @param $limit |
||||||
| 22 | * @param $dateFormat |
||||||
| 23 | * @param $itemsSize |
||||||
| 24 | * |
||||||
| 25 | * @return array |
||||||
| 26 | */ |
||||||
| 27 | |||||||
| 28 | // ------------------------------------------------------------------------ // |
||||||
| 29 | // Article plugin for Marquee 2.4 // |
||||||
| 30 | // written by Defkon1 [defkon1 at gmail dot com] // |
||||||
| 31 | // ------------------------------------------------------------------------ // |
||||||
| 32 | use XoopsModules\Article; |
||||||
|
0 ignored issues
–
show
|
|||||||
| 33 | |||||||
| 34 | /** |
||||||
| 35 | * @param $limit |
||||||
| 36 | * @param $dateFormat |
||||||
| 37 | * @param $itemsSize |
||||||
| 38 | * @return array|false |
||||||
| 39 | */ |
||||||
| 40 | function b_marquee_article($limit, $dateFormat, $itemsSize) |
||||||
| 41 | { |
||||||
| 42 | global $xoopsDB; |
||||||
| 43 | // require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php'; |
||||||
| 44 | require_once XOOPS_ROOT_PATH . '/modules/article/include/functions.php'; |
||||||
| 45 | $block = []; |
||||||
|
0 ignored issues
–
show
|
|||||||
| 46 | $myts = \MyTextSanitizer::getInstance(); |
||||||
|
0 ignored issues
–
show
|
|||||||
| 47 | static $accessCats; |
||||||
| 48 | $artConfig = art_load_config(); |
||||||
|
0 ignored issues
–
show
The function
art_load_config was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 49 | art_define_url_delimiter(); |
||||||
|
0 ignored issues
–
show
The function
art_define_url_delimiter was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 50 | $select = 'art_id'; |
||||||
| 51 | $dispTag = ''; |
||||||
|
0 ignored issues
–
show
|
|||||||
| 52 | $from = ''; |
||||||
| 53 | $where = ''; |
||||||
| 54 | $order = 'art_time_publish DESC'; |
||||||
| 55 | $select .= ', cat_id, art_title, uid, art_time_publish'; |
||||||
| 56 | if (null === $accessCats) { |
||||||
| 57 | $permissionHandler = Article\Helper::getInstance()->getHandler('Permission'); |
||||||
|
0 ignored issues
–
show
The type
XoopsModules\Article\Helper was not found. Maybe you did not declare it correctly or list all dependencies?
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. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||||
| 58 | $accessCats = $permissionHandler->getCategories('access'); |
||||||
| 59 | } |
||||||
| 60 | $allowedCats = $accessCats; |
||||||
| 61 | $sql = "SELECT $select FROM " . art_DB_prefix('article') . $from; |
||||||
|
0 ignored issues
–
show
The function
art_DB_prefix was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 62 | $sql .= ' WHERE cat_id IN (' . implode(',', $allowedCats) . ') AND art_time_publish >0 ' . $where; |
||||||
| 63 | $sql .= ' ORDER BY ' . $order; |
||||||
| 64 | $sql .= ' LIMIT 0, ' . $limit; |
||||||
| 65 | $result = $xoopsDB->query($sql); |
||||||
| 66 | if (!$xoopsDB->isResultSet($result)) { |
||||||
| 67 | return false; |
||||||
| 68 | } |
||||||
| 69 | $rows = []; |
||||||
| 70 | $author = []; |
||||||
| 71 | while (false !== ($row = $xoopsDB->fetchArray($result))) { |
||||||
| 72 | $rows[] = $row; |
||||||
| 73 | $author[$row['uid']] = 1; |
||||||
| 74 | } |
||||||
| 75 | if (count($rows) < 1) { |
||||||
| 76 | return false; |
||||||
| 77 | } |
||||||
| 78 | $authorName = \XoopsUser::getUnameFromId(array_keys($author)); |
||||||
|
0 ignored issues
–
show
array_keys($author) of type array is incompatible with the type integer expected by parameter $userid of XoopsUser::getUnameFromId().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 79 | $arts = []; |
||||||
| 80 | $uids = []; |
||||||
|
0 ignored issues
–
show
|
|||||||
| 81 | $cids = []; |
||||||
| 82 | $articleHandler = Article\Helper::getInstance()->getHandler('Article'); |
||||||
| 83 | foreach ($rows as $row) { |
||||||
| 84 | $article = $articleHandler->create(false); |
||||||
| 85 | $article->assignVars($row); |
||||||
| 86 | $_art = []; |
||||||
| 87 | foreach ($row as $tag => $val) { |
||||||
| 88 | $_art[$tag] = @$article->getVar($tag); |
||||||
| 89 | } |
||||||
| 90 | $_art['author'] = $authorName[$row['uid']]; |
||||||
| 91 | $_art['date'] = $article->getTime($dateFormat); |
||||||
| 92 | $titlelength = $itemsSize + 3; |
||||||
| 93 | $_art['title'] = xoops_substr($_art['art_title'], 0, $titlelength); |
||||||
| 94 | $_art['category'] = ''; |
||||||
| 95 | $delimiter = '/'; |
||||||
| 96 | $_art['link'] = '<a href="' . XOOPS_URL . "modules/article/view.article.php$delimiter" . $_art['art_id'] . '/c' . $_art['cat_id'] . '"><strong>' . $_art['art_title'] . '</strong></a>'; |
||||||
| 97 | $arts[] = $_art; |
||||||
| 98 | unset($article, $_art); |
||||||
| 99 | $cids[$row['cat_id']] = 1; |
||||||
| 100 | } |
||||||
| 101 | $block = $arts; |
||||||
| 102 | |||||||
| 103 | return $block; |
||||||
| 104 | } |
||||||
| 105 |
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