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/AdsenseHandler.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
27
28
/**
29
 * Class SmartobjectAdsenseHandler
30
 */
31
class AdsenseHandler extends Smartobject\PersistableObjectHandler
32
{
33
    public $adFormats;
34
    public $adFormatsList;
35
    public $objects = false;
36
//    public $classname = Adsense::class;
37
38
    /**
39
     * SmartobjectAdsenseHandler constructor.
40
     * @param \XoopsDatabase $db
41
     */
42
    public function __construct(\XoopsDatabase $db)
43
    {
44
        parent::__construct($db, Adsense::class, 'adsenseid', 'description', '', 'smartobject');
45
        $this->adFormats     = [];
46
        $this->adFormatsList = [];
47
48
        $this->adFormats['728x90_as']['caption'] = '728 X 90 Leaderboard';
49
        $this->adFormats['728x90_as']['width']   = 728;
50
        $this->adFormats['728x90_as']['height']  = 90;
51
        $this->adFormatsList['728x90_as']        = $this->adFormats['728x90_as']['caption'];
52
53
        $this->adFormats['468x60_as']['caption'] = '468 X 60 Banner';
54
        $this->adFormats['468x60_as']['width']   = 468;
55
        $this->adFormats['468x60_as']['height']  = 60;
56
        $this->adFormatsList['468x60_as']        = $this->adFormats['468x60_as']['caption'];
57
58
        $this->adFormats['234x60_as']['caption'] = '234 X 60 Half Banner';
59
        $this->adFormats['234x60_as']['width']   = 234;
60
        $this->adFormats['234x60_as']['height']  = 60;
61
        $this->adFormatsList['234x60_as']        = $this->adFormats['234x60_as']['caption'];
62
63
        $this->adFormats['120x600_as']['caption'] = '120 X 600 Skyscraper';
64
        $this->adFormats['120x600_as']['width']   = 120;
65
        $this->adFormats['120x600_as']['height']  = 600;
66
        $this->adFormatsList['120x600_as']        = $this->adFormats['120x600_as']['caption'];
67
68
        $this->adFormats['160x600_as']['caption'] = '160 X 600 Wide Skyscraper';
69
        $this->adFormats['160x600_as']['width']   = 160;
70
        $this->adFormats['160x600_as']['height']  = 600;
71
        $this->adFormatsList['160x600_as']        = $this->adFormats['160x600_as']['caption'];
72
73
        $this->adFormats['120x240_as']['caption'] = '120 X 240 Vertical Banner';
74
        $this->adFormats['120x240_as']['width']   = 120;
75
        $this->adFormats['120x240_as']['height']  = 240;
76
        $this->adFormatsList['120x240_as']        = $this->adFormats['120x240_as']['caption'];
77
78
        $this->adFormats['336x280_as']['caption'] = '336 X 280 Large Rectangle';
79
        $this->adFormats['336x280_as']['width']   = 136;
80
        $this->adFormats['336x280_as']['height']  = 280;
81
        $this->adFormatsList['336x280_as']        = $this->adFormats['336x280_as']['caption'];
82
83
        $this->adFormats['300x250_as']['caption'] = '300 X 250 Medium Rectangle';
84
        $this->adFormats['300x250_as']['width']   = 300;
85
        $this->adFormats['300x250_as']['height']  = 250;
86
        $this->adFormatsList['300x250_as']        = $this->adFormats['300x250_as']['caption'];
87
88
        $this->adFormats['250x250_as']['caption'] = '250 X 250 Square';
89
        $this->adFormats['250x250_as']['width']   = 250;
90
        $this->adFormats['250x250_as']['height']  = 250;
91
        $this->adFormatsList['250x250_as']        = $this->adFormats['250x250_as']['caption'];
92
93
        $this->adFormats['200x200_as']['caption'] = '200 X 200 Small Square';
94
        $this->adFormats['200x200_as']['width']   = 200;
95
        $this->adFormats['200x200_as']['height']  = 200;
96
        $this->adFormatsList['200x200_as']        = $this->adFormats['200x200_as']['caption'];
97
98
        $this->adFormats['180x150_as']['caption'] = '180 X 150 Small Rectangle';
99
        $this->adFormats['180x150_as']['width']   = 180;
100
        $this->adFormats['180x150_as']['height']  = 150;
101
        $this->adFormatsList['180x150_as']        = $this->adFormats['180x150_as']['caption'];
102
103
        $this->adFormats['125x125_as']['caption'] = '125 X 125 Button';
104
        $this->adFormats['125x125_as']['width']   = 125;
105
        $this->adFormats['125x125_as']['height']  = 125;
106
        $this->adFormatsList['125x125_as']        = $this->adFormats['125x125_as']['caption'];
107
    }
108
109
    /**
110
     * @return array
111
     */
112
    public function getFormats()
113
    {
114
        return $this->adFormatsList;
115
    }
116
117
    /**
118
     * @param $obj
119
     * @return bool
120
     */
121
    public function beforeSave($obj)
122
    {
123
        if ('' === $obj->getVar('tag')) {
124
            $obj->setVar('tag', $title = $obj->generateTag());
125
        }
126
127
        return true;
128
    }
129
130
    /**
131
     * @return array|bool
132
     */
133
    public function getAdsensesByTag()
134
    {
135
        if (!$this->objects) {
136
            $adsensesObj =& $this->getObjects(null, true);
137
            $ret         = [];
138
            foreach ($adsensesObj as $adsenseObj) {
139
                $ret[$adsenseObj->getVar('tag')] = $adsenseObj;
140
            }
141
            $this->objects = $ret;
0 ignored issues
show
Documentation Bug introduced by
It seems like $ret of type array is incompatible with the declared type boolean of property $objects.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
142
        }
143
144
        return $this->objects;
145
    }
146
}
147