Issues (496)

Security Analysis    not enabled

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

  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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/Currency.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php namespace XoopsModules\Smartobject;
2
3
/*
4
 * You may not change or alter any portion of this comment or credits
5
 * of supporting developers from this source code or any supporting source code
6
 * which is considered copyrighted (c) material of the original comment or credit authors.
7
 *
8
 * This program is distributed in the hope that it will be useful,
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 */
12
13
/**
14
 * @copyright    XOOPS Project https://xoops.org/
15
 * @license      GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
16
 * @package
17
 * @since
18
 * @author     XOOPS Development Team
19
 */
20
21
use XoopsModules\Smartobject;
22
23
// defined('XOOPS_ROOT_PATH') || die('Restricted access');
24
25
//require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php';
26
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
27
28
/**
29
 * Class SmartobjectCurrency
30
 */
31
class Currency extends Smartobject\BaseSmartObject
32
{
33
    public $_modulePlugin = false;
34
35
    /**
36
     * SmartobjectCurrency constructor.
37
     */
38
    public function __construct()
39
    {
40
        $this->quickInitVar('currencyid', XOBJ_DTYPE_INT, true);
41
        $this->quickInitVar('iso4217', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CURRENCY_ISO4217, _CO_SOBJECT_CURRENCY_ISO4217_DSC);
42
        $this->quickInitVar('name', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CURRENCY_NAME);
43
        $this->quickInitVar('symbol', XOBJ_DTYPE_TXTBOX, true, _CO_SOBJECT_CURRENCY_SYMBOL);
44
        $this->quickInitVar('rate', XOBJ_DTYPE_FLOAT, true, _CO_SOBJECT_CURRENCY_RATE, '', '1.0');
45
        $this->quickInitVar('default_currency', XOBJ_DTYPE_INT, false, _CO_SOBJECT_CURRENCY_DEFAULT, '', false);
46
47
        $this->setControl('symbol', [
48
            'name'      => 'text',
49
            'size'      => '15',
50
            'maxlength' => '15'
51
        ]);
52
53
        $this->setControl('iso4217', [
54
            'name'      => 'text',
55
            'size'      => '5',
56
            'maxlength' => '5'
57
        ]);
58
59
        $this->setControl('rate', [
60
            'name'      => 'text',
61
            'size'      => '5',
62
            'maxlength' => '5'
63
        ]);
64
65
        $this->setControl('rate', [
66
            'name'      => 'text',
67
            'size'      => '5',
68
            'maxlength' => '5'
69
        ]);
70
71
        $this->hideFieldFromForm('default_currency');
72
    }
73
74
    /**
75
     * @param  string $key
76
     * @param  string $format
77
     * @return mixed
78
     */
79 View Code Duplication
    public function getVar($key, $format = 's')
0 ignored issues
show
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
80
    {
81
        if ('s' === $format && in_array($key, ['rate', 'default_currency'])) {
82
            //            return call_user_func(array($this, $key));
83
            return $this->{$key}();
84
        }
85
86
        return parent::getVar($key, $format);
87
    }
88
89
    /**
90
     * @return mixed
91
     */
92
    public function getCurrencyLink()
93
    {
94
        $ret = $this->getVar('name', 'e');
95
96
        return $ret;
97
    }
98
99
    /**
100
     * @return mixed
101
     */
102
    public function getCode()
103
    {
104
        $ret = $this->getVar('iso4217', 'e');
105
106
        return $ret;
107
    }
108
109
    /**
110
     * @return float|int|mixed|string
111
     */
112
    public function rate()
113
    {
114
        return Smartobject\Utility::getCurrency($this->getVar('rate', 'e'));
115
    }
116
117
    /**
118
     * @return string
119
     */
120
    public function defaultCurrency()
121
    {
122
        if (true === $this->getVar('default_currency', 'e')) {
123
            return _YES;
124
        } else {
125
            return _NO;
126
        }
127
    }
128
129
    /**
130
     * @return string
131
     */
132
    public function getDefaultCurrencyControl()
133
    {
134
        $radio_box = '<input name="default_currency" value="' . $this->getVar('currencyid') . '" type="radio"';
135
        if ($this->getVar('default_currency', 'e')) {
136
            $radio_box .= 'checked';
137
        }
138
        $radio_box .= '>';
139
140
        return $radio_box;
141
    }
142
}
143