Issues (93)

Security Analysis    no request data  

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.

ClashAPI/Clan.class.php (2 issues)

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
/**
4
 * Class to get information about Clans. This class uses the data provided by the API.class.php
5
 */
6
7
class CoC_Clan
8
{
9
	protected $api;
10
	protected $tag; 
11
	protected $clan = NULL;
12
13
	/**
14
	 * Constructor of CoC_Clan
15
	 * Either pass the clan tag or a stdClass containing all clan information.
16
	 *
17
	 * @param $tagOrClass
18
	 * @param (optional) $isTag
0 ignored issues
show
There is no parameter named $isTag. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
19
	 */
20
	public function __construct($tagOrClass)
21
	{
22
		$this->api = new ClashOfClans();
23
		if(is_string($tagOrClass))
24
		{
25
			$this->tag = $tagOrClass;
26
			$this->getClan();
27
		}
28
		else
29
		{
30
			$this->clan = $tagOrClass;
31
		}
32
   	}
33
	
34
   	protected function getClan()
35
   	{
36
   		if($this->clan == NULL)
37
		{
38
			$this->clan = $this->api->getClanByTag($this->tag);
39
		}
40
		return $this->clan;
41
   	}
42
43
	/**
44
	 * Gets the clantag
45
	 *
46
	 * @return string, clantag
47
	 */
48
   	public function getTag()
49
   	{
50
   		return $this->tag;
51
   	}
52
53
   	/**
54
   	 * Gets the clan's name
55
   	 *
56
   	 * @return string, name
57
   	 */
58
	public function getName()
59
	{
60
		return $this->getClan()->name;
61
	}
62
63
	/**
64
	 * Gets the clan's description
65
	 *
66
	 * @return string, description
67
	 */
68
	public function getDescription()
69
	{
70
		return $this->getClan()->description;
71
	}
72
73
	/**
74
	 * Gets the clan's type
75
	 *
76
	 * @return string, type ("open", "inviteOnly" or "closed")
77
	 */
78
	public function getType()
79
	{
80
		return $this->getClan()->type;
81
	}
82
83
	/**
84
	 * Gets the clan's location ID. You can get more information about a location using the Location.class.php
85
	 *
86
	 * @return int, locationId
87
	 */
88
	public function getLocationId()
89
	{
90
		return $this->getClan()->location->id;
91
	}
92
	
93
	/**
94
	 * Gets the clan's location.
95
	 *
96
	 * @return stdClass
97
	 */
98
	public function getLocation()
99
	{
100
		return $this->getClan()->location;
101
	}
102
103
	/**
104
	 * Get's the URL to the clan badge in the given size.
105
	 * 
106
	 * @param (optional) $size ("small", "medium", "large")
107
	 * @return string, URL to the picture
108
	 */
109
	public function getBadgeUrl($size = "") //small, large, medium.
110
	{
111
		switch ($size)
112
		{
113
			case "small":
114
				return $this->getClan()->badgeUrls->small; 
115
				break;
116
			case "medium":
117
				return $this->getClan()->badgeUrls->medium;
118
				break;
119
			case "large":
120
				return $this->getClan()->badgeUrls->large;
121
				break;
122
			default:
123
				return $this->getClan()->badgeUrls->large; //return the largest because it can be resized using HTML
124
				break;
125
		}
126
		
127
	}
128
129
	/**
130
	 * Gets the clan's war frequency
131
	 *
132
	 * @return string, war-frequency ("always", "lessThanOncePerWeek", "once per week", "moreThanOncePerWeek" or "unknown")
133
	 */
134
	public function getWarFrequency()
135
	{
136
		return $this->getClan()->warFrequency;
137
	}
138
139
	/**
140
	 * Gets the clan's level
141
	 *
142
	 * @return int, level
143
	 */
144
	public function getLevel()
145
	{
146
		return $this->getClan()->clanLevel;
147
	}
148
149
	/**
150
	 * Gets the clan's war wins
151
	 *
152
	 * @return int, wins
153
	 */
154
	public function getWarWins()
155
	{
156
		return $this->getClan()->warWins;
157
	}
158
159
	/**
160
	 * Gets the clan's war win streak
161
	 *
162
	 * @return int, win streak
163
	 */
164
	public function getWarWinStreak()
165
	{
166
		return $this->getClan()->warWinStreak;
167
	}
168
169
	/**
170
	 * Gets the clan's points (trophies)
171
	 *
172
	 * @return int, points
173
	 */
174
	public function getPoints()
175
	{
176
		return $this->getClan()->clanPoints;
177
	}
178
179
	/**
180
	 * Gets the clan's required trophies to join
181
	 *
182
	 * @return int, required trophies
183
	 */
184
	public function getRequiredTrophies()
185
	{
186
		return $this->getClan()->requiredTrophies;
187
	}
188
189
	/**
190
	 * Gets the amount of members in the clan
191
	 *
192
	 * @return int, membercount
193
	 */
194
	public function getMemberCount()
195
	{
196
		return $this->getClan()->members;
197
	}
198
199
	/**
200
	 * Gets a member from the clan by providing an index (usually clan-ranklist position - 1)
201
	 * Member.class.php will work with the returned class.
202
	 *
203
	 * @return stdClass, member
204
	 */
205
	public function getMemberByIndex($index)
206
	{
207
		return $this->getClan()->memberList[$index];
208
	}
209
210
	/**
211
	 * Gets an array of all members in the clan
212
	 *
213
	 * @return array (type of stdClass), all members
214
	 */
215
	public function getAllMembers()
216
	{
217
		return $this->getClan()->memberList;
218
	}
219
220
	/**
221
	 * Gets the first(!) member with the given name
222
	 * If there are multiple members using the same name inside the clan, use a different method.
223
	 *
224
	 * @return stdClass, member
225
	 */
226
	public function getMemberByName($name)
227
	{
228
		foreach ($this->api->getClan()->memberList as $member)
0 ignored issues
show
The method getClan() does not exist on ClashOfClans. Did you maybe mean getClanByTag()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
229
		{
230
			if ($member->name == $name)
231
			{
232
				return $member;
233
			}
234
		}
235
		return 0;
236
	} 
237
};