Issues (519)

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.

class/Files/Language/LanguageBlocks.php (3 issues)

1
<?php namespace XoopsModules\Tdmcreate\Files\Language;
2
3
use XoopsModules\Tdmcreate;
4
use XoopsModules\Tdmcreate\Files;
5
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
11
 This program is distributed in the hope that it will be useful,
12
 but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14
 */
15
/**
16
 * tdmcreate module.
17
 *
18
 * @copyright       XOOPS Project (https://xoops.org)
19
 * @license         GNU GPL 2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
20
 *
21
 * @since           2.5.0
22
 *
23
 * @author          Txmod Xoops http://www.txmodxoops.org
24
 *
25
 * @version         $Id: LanguageBlocks.php 12258 2014-01-02 09:33:29Z timgno $
26
 */
27
28
/**
29
 * Class LanguageBlocks.
30
 */
31
class LanguageBlocks extends Files\CreateFile
32
{
33
    /**
34
     *  @public function constructor
35
     *  @param null
36
     */
37
    public function __construct()
38
    {
39
        parent::__construct();
40
        $this->defines = LanguageDefines::getInstance();
0 ignored issues
show
Bug Best Practice introduced by
The property defines does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
41
    }
42
43
    /**
44
     *  @static function getInstance
45
     *  @param null
46
     * @return LanguageBlocks
47
     */
48
    public static function getInstance()
49
    {
50
        static $instance = false;
51
        if (!$instance) {
52
            $instance = new self();
53
        }
54
55
        return $instance;
56
    }
57
58
    /**
59
     *  @public function write
60
     *  @param string $module
61
     *  @param mixed $tables
62
     *  @param string $filename
63
     */
64
    public function write($module, $tables, $filename)
65
    {
66
        $this->setModule($module);
67
        $this->setFileName($filename);
68
        $this->setTables($tables);
69
    }
70
71
    /**
72
     *  @private function getLanguageBlock
73
     *  @param string $language
74
     *  @param string $module
75
     *
76
     * @return string
77
     */
78
    private function getLanguageBlock($module, $language)
0 ignored issues
show
The parameter $module is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

78
    private function getLanguageBlock(/** @scrutinizer ignore-unused */ $module, $language)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
79
    {
80
        $tables = $this->getTables();
81
        $ret = $this->defines->getAboveDefines('Admin Edit');
82
        $ret .= $this->defines->getDefine($language, 'DISPLAY', 'How Many Tables to Display');
83
        $ret .= $this->defines->getDefine($language, 'TITLE_LENGTH', 'Title Length');
84
        $ret .= $this->defines->getDefine($language, 'CATTODISPLAY', 'Categories to Display');
85
        $ret .= $this->defines->getDefine($language, 'ALLCAT', 'All Categories');
86
        foreach (array_keys($tables) as $t) {
87
            $tableName = $tables[$t]->getVar('table_name');
88
            $ucfTableName = ucfirst($tableName);
89
            $ret .= $this->defines->getAboveDefines($ucfTableName);
90
            $fields = $this->getTableFields($tables[$t]->getVar('table_mid'), $tables[$t]->getVar('table_id'));
91
            foreach (array_keys($fields) as $f) {
92
                $fieldName = $fields[$f]->getVar('field_name');
93
                $stuFieldName = mb_strtoupper($fieldName);
94
95
                $rpFieldName = $this->getRightString($fieldName);
96
                $lpFieldName = mb_substr($fieldName, 0, mb_strpos($fieldName, '_'));
0 ignored issues
show
The assignment to $lpFieldName is dead and can be removed.
Loading history...
97
98
                $fieldNameDesc = ucfirst($rpFieldName);
99
100
                $ret .= $this->defines->getDefine($language, $stuFieldName, $fieldNameDesc);
101
            }
102
        }
103
104
        return $ret;
105
    }
106
107
    /**
108
     *  @private function getFooter
109
     *  @param null
110
     * @return string
111
     */
112
    private function getLanguageFooter()
113
    {
114
        $ret = $this->defines->getBelowDefines('End');
115
116
        return $ret;
117
    }
118
119
    /**
120
     *  @public function render
121
     *  @param null
122
     * @return bool|string
123
     */
124
    public function render()
125
    {
126
        $module = $this->getModule();
127
        $filename = $this->getFileName();
128
        $moduleDirname = $module->getVar('mod_dirname');
129
        $language = $this->getLanguage($moduleDirname, 'MB');
130
        $content = $this->getHeaderFilesComments($module, $filename);
131
        $content .= $this->getLanguageBlock($module, $language);
132
        $content .= $this->getLanguageFooter();
133
134
        $this->create($moduleDirname, 'language/' . $GLOBALS['xoopsConfig']['language'], $filename, $content, _AM_TDMCREATE_FILE_CREATED, _AM_TDMCREATE_FILE_NOTCREATED);
135
136
        return $this->renderFile();
137
    }
138
}
139