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/heartrails.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 MylinksHeartrails
39
 */
40
class MylinksHeartrails 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   = '';
48
    private   $provider_url  = 'http://capture.heartrails.com';
49
    private   $provider_name = 'Heartrails';
50
51
    /**
52
     * MylinksHeartrails constructor.
53
     */
54
    public function __construct()
55
    {
56
    }
57
58
    /**
59
     * @return string
60
     */
61
    public function getProviderUrl()
62
    {
63
        $query       = '/' . $this->image_width . 'x' . $this->image_height . '/cool?' . $this->getSiteUrl();
64
        $providerUrl = $this->provider_url . $query;
65
66
        return $providerUrl;
67
    }
68
69
    /**
70
     * @return string
71
     */
72
    public function getProviderName()
73
    {
74
        return $this->provider_name;
75
    }
76
77
    /**
78
     * @param $sz
79
     * @return mixed|void
80
     */
81
    public function setShotSize($sz)
82
    {
83
        if (isset($sz)) {
84 View Code Duplication
            if (is_array($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...
85
                if (array_key_exists('width', $sz)) {
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
            }
97
        }
98
    }
99
100
    /**
101
     * @return array
102
     */
103
    public function getShotSize()
104
    {
105
        return array('width' => $this->image_width, 'height' => $this->image_height);
106
    }
107
108
    /**
109
     * @param $url
110
     * @return mixed|void
111
     */
112
    public function setSiteUrl($url)
113
    {
114
        //@todo: sanitize url;
115
        $this->site_url = formatURL($url);
116
    }
117
118
    /**
119
     * @return string
120
     */
121
    public function getSiteUrl()
122
    {
123
        return urlencode($this->site_url);
124
    }
125
126
    /**
127
     * @param null $attr
128
     */
129
    public function setAttribution($attr = null)
130
    {
131
        $this->attribution = $attr;
132
    }
133
134
    /**
135
     * @param int $allowhtml
136
     * @return string
137
     */
138
    public function getAttribution($allowhtml = 0)
139
    {
140
        if ($allowhtml) {
141
            return $this->attribution;
142
        } else {
143
            $myts = MyTextSanitizer::getInstance();
144
145
            return $myts->htmlSpecialChars($this->attribution);
146
        }
147
    }
148
149
    /**
150
     * @param $key
151
     * @return bool
152
     */
153
    public function setProviderPublicKey($key)
154
    {
155
        return false;
156
    }
157
158
    /**
159
     * @return bool
160
     */
161
    public function getProviderPublicKey()
162
    {
163
        return false;
164
    }
165
166
    /**
167
     * @param $key
168
     * @return bool
169
     */
170
    public function setProviderPrivateKey($key)
171
    {
172
        return false;
173
    }
174
175
    /**
176
     * @return bool
177
     */
178
    public function getProviderPrivateKey()
179
    {
180
        return false;
181
    }
182
}
183