Issues (661)

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/providers/nemui.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
2
/*
3
 * You may not change or alter any portion of this comment or credits
4
 * of supporting developers from this source code or any supporting source code
5
 * which is considered copyrighted (c) material of the original comment or credit authors.
6
 * This program is distributed in the hope that it will be useful,
7
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
8
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
9
 *
10
 * to use the provider:
11
 * $shot = new MylinksThumbshots();
12
 * $shot->setProviderPrivateKey(my_key);
13
 * $shot->setShotSize(array('width'=>120));
14
 * $shot->setSiteUrl("http://site_to_capture");
15
 * $mylinks_shotprovider = $shot->getProviderUrl();
16
 *
17
 * Then in the template use something like:
18
 *  <img src='<{$mylinks_shotprovider}>' target='_blank' alt='' style='margin: 3px 7px;'>
19
 *  and at the bottom of the page show the attribution
20
 *  echo $shot->getAttribution();
21
 */
22
23
/**
24
 * MyLinks category.php
25
 *
26
 * Xoops mylinks - a multicategory links module
27
 *
28
 * @copyright ::  {@link http://xoops.org/ XOOPS Project}
29
 * @copyright ::  {@link http://www.zyspec.com ZySpec Incorporated}
30
 * @license   ::    {@link http://www.gnu.org/licenses/gpl-2.0.html GNU Public License}
31
 * @package   ::    mylinks
32
 * @subpackage:: class
33
 * @author    ::     zyspec <[email protected]>
34
 */
35
require_once XOOPS_ROOT_PATH . '/modules/mylinks/class/thumbplugin.interface.php';
36
37
/**
38
 * Class MylinksNemui
39
 */
40
class MylinksNemui implements MylinksThumbPlugin
41
{
42
    private   $image_width   = 0;
43
    private   $image_height  = 0;
44
    protected $image_ratio   = 1.33;  // (4:3)
45
    private   $site_url      = null;
46
    private   $key           = null;
47
    private   $attribution   = "<a href=\"http://mozshot.nemui.org\" target=\"_blank\" title=\"Thumbnails Screenshots by Nemui.org\">Thumbnail Screenshots by Nemui.org</a>";
48
    private   $provider_url  = 'http://mozshot.nemui.org';
49
    private   $provider_name = 'Nemui';
50
51
    /**
52
     * MylinksNemui constructor.
53
     */
54
    public function __construct()
55
    {
56
    }
57
58
    /**
59
     * @return string
60
     */
61
    public function getProviderUrl()
62
    {
63
        $sz          = $this->getShotSize();
64
        $image_size  = $sz['width'] . 'x' . $sz['height'];
65
        $providerUrl = $this->provider_url . "/shot/{$image_size}?" . $this->site_url;
66
67
        return $providerUrl;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getProviderName()
74
    {
75
        return $this->provider_name;
76
    }
77
78
    /**
79
     * @param $sz
80
     * @return mixed|void
81
     */
82
    public function setShotSize($sz)
83
    {
84
        if (is_array($sz)) {
85 View Code Duplication
            if (array_key_exists('width', $sz)) {
0 ignored issues
show
This code seems to be duplicated across 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...
86
                $this->image_width = (int)$sz['width'];
87
                if (array_key_exists('height', $sz)) {
88
                    $this->image_height = (int)$sz['height'];
89
                } else {
90
                    $this->image_height = (int)($this->image_width / $this->image_ratio);
91
                }
92
            } else {
93
                $this->image_width  = (int)$sz;
94
                $this->image_height = (int)($sz / $this->image_ratio);
95
            }
96
        } else {
97
            $this->image_width  = (int)$sz;
98
            $this->image_height = (int)($sz / $this->image_ratio);
99
        }
100
    }
101
102
    /**
103
     * @return array
104
     */
105
    public function getShotSize()
106
    {
107
        return array('width' => $this->image_width, 'height' => $this->image_height);
108
    }
109
110
    /**
111
     * @param $url
112
     * @return mixed|void
113
     */
114
    public function setSiteUrl($url)
115
    {
116
        //@todo: sanitize url;
117
        $this->site_url = formatURL($url);
118
    }
119
120
    /**
121
     * @return string
122
     */
123
    public function getSiteUrl()
124
    {
125
        return urlencode($this->site_url);
126
    }
127
128
    /**
129
     * @param null $attr
130
     */
131
    public function setAttribution($attr = null)
132
    {
133
        $this->attribution = $attr;
134
    }
135
136
    /**
137
     * @param int $allowhtml
138
     * @return string
139
     */
140
    public function getAttribution($allowhtml = 0)
141
    {
142
        if ($allowhtml) {
143
            return $this->attribution;
144
        } else {
145
            $myts = MyTextSanitizer::getInstance();
146
147
            return $myts->htmlSpecialChars($this->attribution);
148
        }
149
    }
150
151
    /**
152
     * @param $key
153
     * @return mixed|void
154
     */
155
    public function setProviderPublicKey($key)
156
    {
157
        $this->key = $key;
158
    }
159
160
    /**
161
     * @return null
162
     */
163
    public function getProviderPublicKey()
164
    {
165
        return $this->key;
166
    }
167
168
    /**
169
     * @param $key
170
     * @return bool
171
     */
172
    public function setProviderPrivateKey($key)
173
    {
174
        return false;
175
    }
176
177
    /**
178
     * @return bool
179
     */
180
    public function getProviderPrivateKey()
181
    {
182
        return false;
183
    }
184
}
185