Issues (299)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  Header Injection
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

include/functions.render.php (1 issue)

Labels
Severity
1
<?php declare(strict_types=1);
2
3
/**
4
 * CBB 4.0, or newbb, the forum module for XOOPS project
5
 *
6
 * @copyright   XOOPS Project (https://xoops.org)
7
 * @license     GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
8
 * @author      Taiwen Jiang (phppp or D.J.) <[email protected]>
9
 * @since       4.00
10
 */
11
12
use XoopsModules\Newbb\IconHandler;
0 ignored issues
show
The type XoopsModules\Newbb\IconHandler 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. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
use XoopsModules\Smartfaq;
14
15
defined('NEWBB_FUNCTIONS_INI') || require __DIR__ . '/functions.ini.php';
16
define('NEWBB_FUNCTIONS_RENDER_LOADED', true);
17
18
if (!defined('NEWBB_FUNCTIONS_RENDER')) :
19
    define('NEWBB_FUNCTIONS_RENDER', 1);
20
21
    /*
22
     * Sorry, we have to use the stupid solution unless there is an option in MyTextSanitizer:: htmlspecialchars();
23
     */
24
    /**
25
     * @param $text
26
     * @return mixed
27
     */
28
    function sf_htmlSpecialChars($text)
29
    {
30
        return preg_replace(['/&amp;/i', '/&nbsp;/i'], ['&', '&amp;nbsp;'], htmlspecialchars($text, ENT_QUOTES));
31
    }
32
33
    /**
34
     * @param int   $html
35
     * @param int   $smiley
36
     * @param int   $xcode
37
     * @param int   $image
38
     * @param int   $br
39
     * @param mixed $text
40
     * @return mixed
41
     */
42
    function &sf_displayTarea(&$text, $html = 0, $smiley = 1, $xcode = 1, $image = 1, $br = 1)
43
    {
44
        global $myts;
45
46
        if (1 != $html) {
47
            // html not allowed
48
            $text = sf_htmlSpecialChars($text);
49
        }
50
        $text = $myts->codePreConv($text, $xcode); // Ryuji_edit(2003-11-18)
51
        $text = $myts->makeClickable($text);
52
        if (0 != $smiley) {
53
            // process smiley
54
            $text = $myts->smiley($text);
55
        }
56
        if (0 != $xcode) {
57
            // decode xcode
58
            if (0 != $image) {
59
                // image allowed
60
                $text = &$myts->xoopsCodeDecode($text);
61
            } else {
62
                // image not allowed
63
                $text = &$myts->xoopsCodeDecode($text, 0);
64
            }
65
        }
66
        if (0 != $br) {
67
            $text = &$myts->nl2Br($text);
68
        }
69
        $text = $myts->codeConv($text, $xcode, $image);    // Ryuji_edit(2003-11-18)
70
71
        return $text;
72
    }
73
74
    /**
75
     * @param $document
76
     * @return string
77
     */
78
    function sf_html2text($document)
79
    {
80
        $text = strip_tags($document);
81
82
        return $text;
83
    }
84
85
    /**
86
     * Display forrum button
87
     *
88
     * @param string $link
89
     * @param string $button  image/button name, without extension
90
     * @param string $alt     alt message
91
     * @param bool   $asImage true for image mode; false for text mode
92
     * @param string $extra   extra attribute for the button
93
     * @return mixed
94
     */
95
    function sf_getButton($link, $button, $alt = '', $asImage = true, $extra = "class='forum_button'")
96
    {
97
        $button = "<input type='button' name='{$button}' {$extra} value='{$alt}' onclick='window.location.href={$link}'>";
98
        if (empty($asImage)) {
99
            $button = "<a href='{$link}' title='{$alt}' {$extra}>" . sf_displayImage($button, $alt, true) . '</a>';
100
        }
101
102
        return $button;
103
    }
104
105
    /**
106
     * Display forrum images
107
     *
108
     * @param string $image   image name, without extension
109
     * @param string $alt     alt message
110
     * @param bool   $display true for return image anchor; faulse for assign to $xoopsTpl
111
     * @param string $extra   extra attribute for the image
112
     * @return mixed
113
     */
114
    function sf_displayImage($image, $alt = '', $display = true, $extra = "class='forum_icon'")
115
    {
116
        $iconHandler = sf_getIconHandler();
117
        // START hacked by irmtfan
118
        // to show text links instead of buttons - func_num_args()==2 => only when $image, $alt is set and optional $display not set
119
        /** @var Smartfaq\Helper $helper */
120
        $helper = Smartfaq\Helper::getInstance();
121
122
        if (2 == func_num_args()) {
123
            // overall setting
124
            if (!empty($helper->getConfig('display_text_links'))) {
125
                $display = false;
126
            }
127
            // if set for each link => overwrite $display
128
            if (null !== $helper->getConfig('display_text_each_link')[$image]) {
129
                $display = empty($helper->getConfig('display_text_each_link')[$image]);
130
            }
131
        }
132
        // END hacked by irmtfan
133
        if (empty($display)) {
134
            return $iconHandler->assignImage($image, $alt, $extra);
135
        }
136
137
        return $iconHandler->getImage($image, $alt, $extra);
138
    }
139
140
    /**
141
     * @return \XoopsModules\Newbb\IconHandler
142
     */
143
    function sf_getIconHandler()
144
    {
145
        global $xoTheme, $xoopsConfig;
146
        static $iconHandler;
147
148
        if (isset($iconHandler)) {
149
            return $iconHandler;
150
        }
151
        /*
152
                if (!class_exists('NewbbIconHandler')) {
153
                    // require_once  \dirname(__DIR__) . '/class/icon.php';
154
                }
155
        */
156
        $iconHandler           = IconHandler::getInstance();
157
        $iconHandler->template = $xoTheme->template;
158
        $iconHandler->init($xoopsConfig['language']);
159
160
        return $iconHandler;
161
    }
162
163
endif;
164