Issues (277)

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.

Ajax/common/traits/JsUtilsAjaxTrait.php (1 issue)

Labels
Severity

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
namespace Ajax\common\traits;
4
5
use Ajax\service\JArray;
6
trait JsUtilsAjaxTrait {
7
8
	public function setAjaxLoader($loader) {
9
		$this->js->_setAjaxLoader($loader);
0 ignored issues
show
The property js does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
10
	}
11
12
	/**
13
	 * Performs an ajax GET request
14
	 * @param string $url The url of the request
15
	 * @param string $params JSON parameters
16
	 * @param string $responseElement selector of the HTML element displaying the answer
17
	 * @param string $jsCallback javascript code to execute after the request
18
	 * @param boolean $hasLoader true for showing ajax loader. default : true
19
	 */
20
	public function get($url, $responseElement="", $params="{}", $jsCallback=NULL,$hasLoader=true) {
21
		return $this->js->_get($url, $params, $responseElement, $jsCallback, NULL, $hasLoader,true);
22
	}
23
24
	/**
25
	 * Performs an ajax request and receives the JSON data types by assigning DOM elements with the same name
26
	 * @param string $url the request url
27
	 * @param string $params JSON parameters
28
	 * @param string $method Method used
29
	 * @param string $jsCallback javascript code to execute after the request
30
	 * @param boolean $immediatly
31
	 */
32
	public function json($url, $method="get", $params="{}", $jsCallback=NULL, $attr="id", $context="document",$immediatly=false) {
33
		return $this->js->_json($url, $method, $params, $jsCallback, $attr, $context,$immediatly);
34
	}
35
36
	/**
37
	 * Makes an ajax request and receives the JSON data types by assigning DOM elements with the same name when $event fired on $element
38
	 * @param string $element
39
	 * @param string $event
40
	 * @param string $url the request address
41
	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","immediatly"=>true)
42
	 */
43
	public function jsonOn($event,$element, $url,$parameters=array()) {
44
		return $this->js->_jsonOn($event, $element, $url,$parameters);
45
	}
46
47
	/**
48
	 * Prepares an ajax request delayed and receives the JSON data types by assigning DOM elements with the same name
49
	 * @param string $url the request url
50
	 * @param string $params Paramètres passés au format JSON
51
	 * @param string $method Method used
52
	 * @param string $jsCallback javascript code to execute after the request
53
	 */
54
	public function jsonDeferred($url, $method="get", $params="{}", $jsCallback=NULL) {
55
		return $this->js->_json($url, $method, $params, $jsCallback, NULL, false);
56
	}
57
58
	/**
59
	 * Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name
60
	 * @param string $url the request url
61
	 * @param string $params The JSON parameters
62
	 * @param string $method Method used
63
	 * @param string $jsCallback javascript code to execute after the request
64
	 */
65
	public function jsonArray($maskSelector, $url, $method="get", $params="{}", $jsCallback=NULL) {
66
		return $this->js->_jsonArray($maskSelector, $url, $method, $params, $jsCallback, NULL, true);
67
	}
68
69
	/**
70
	 * Peforms an ajax request delayed and receives a JSON array data types by copying and assigning them to the DOM elements with the same name
71
	 * @param string $maskSelector the selector of the element to clone
72
	 * @param string $url the request url
73
	 * @param string $params JSON parameters
74
	 * @param string $method Method used
75
	 * @param string $jsCallback javascript code to execute after the request
76
	 */
77
	public function jsonArrayDeferred($maskSelector, $url, $method="get", $params="{}", $jsCallback=NULL) {
78
		return $this->js->_jsonArray($maskSelector, $url, $method, $params, $jsCallback, NULL, false);
79
	}
80
81
	/**
82
	 * Performs an ajax request and receives the JSON array data types by assigning DOM elements with the same name when $event fired on $element
83
	 * @param string $element
84
	 * @param string $event
85
	 * @param string $url the request url
86
	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","params"=>"{}","method"=>"get","immediatly"=>true)
87
	 */
88
	public function jsonArrayOn($event,$element,$maskSelector, $url,$parameters=array()) {
89
		return $this->js->_jsonArrayOn($event,$element,$maskSelector, $url, $parameters);
90
	}
91
92
	/**
93
	 * Prepares a Get ajax request
94
	 * To use on an event
95
	 * @param string $url The url of the request
96
	 * @param string $params JSON parameters
97
	 * @param string $responseElement selector of the HTML element displaying the answer
98
	 * @param string $jsCallback javascript code to execute after the request
99
	 * @param string $attr the html attribute added to the request
100
	 */
101
	public function getDeferred($url, $responseElement="", $params="{}", $jsCallback=NULL,$attr="id") {
102
		return $this->js->_get($url, $params, $responseElement, $jsCallback, $attr, false);
103
	}
104
105
	/**
106
	 * Performs a get to $url on the event $event on $element
107
	 * and display it in $responseElement
108
	 * @param string $event
109
	 * @param string $element
110
	 * @param string $url The url of the request
111
	 * @param string $responseElement The selector of the HTML element displaying the answer
112
	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"immediatly"=>true)
113
	 */
114
	public function getOn($event, $element, $url, $responseElement="", $parameters=array()) {
115
		$params=JArray::getDefaultValue($parameters, "params", "{}");
116
		return $this->js->_getOn($event, $element, $url, $params, $responseElement, $parameters);
117
	}
118
119
	/**
120
	 * Performs a get to $url on the click event on $element
121
	 * and display it in $responseElement
122
	 * @param string $element
123
	 * @param string $url The url of the request
124
	 * @param string $responseElement The selector of the HTML element displaying the answer
125
	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"params"=>"{}","jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"immediatly"=>true)
126
	 */
127
	public function getOnClick($element, $url, $responseElement="", $parameters=array()) {
128
		return $this->getOn("click", $element, $url, $responseElement, $parameters);
129
	}
130
131
	/**
132
	 * Makes an ajax post
133
	 * @param string $url the request url
134
	 * @param string $params JSON parameters
135
	 * @param string $responseElement selector of the HTML element displaying the answer
136
	 * @param string $jsCallback javascript code to execute after the request
137
	 * @param boolean $hasLoader true for showing ajax loader. default : true
138
	 */
139
	public function post($url, $responseElement="", $params="{}", $jsCallback=NULL,$hasLoader=true) {
140
		return $this->js->_post($url, $params, $responseElement, $jsCallback, NULL, $hasLoader,true);
141
	}
142
143
	/**
144
	 * Prepares a delayed ajax POST
145
	 * to use on an event
146
	 * @param string $url the request url
147
	 * @param string $params JSON parameters
148
	 * @param string $attr the html attribute added to the request
149
	 * @param string $responseElement selector of the HTML element displaying the answer
150
	 * @param string $jsCallback javascript code to execute after the request
151
	 * @param boolean $hasLoader true for showing ajax loader. default : true
152
	 */
153
	public function postDeferred($url, $responseElement="", $params="{}", $jsCallback=NULL, $attr="id",$hasLoader=true) {
154
		return $this->js->_post($url, $params, $responseElement, $jsCallback, $attr, $hasLoader,false);
155
	}
156
157
	/**
158
	 * Performs a post to $url on the event $event fired on $element and pass the parameters $params
159
	 * Display the result in $responseElement
160
	 * @param string $event
161
	 * @param string $element
162
	 * @param string $url The url of the request
163
	 * @param string $params The parameters to send
164
	 * @param string $responseElement selector of the HTML element displaying the answer
165
	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"immediatly"=>true)
166
	 */
167
	public function postOn($event, $element, $url, $params="{}", $responseElement="", $parameters=array()) {
168
		return $this->js->_postOn($event, $element,  $url, $params, $responseElement, $parameters);
169
	}
170
171
	/**
172
	 * Performs a post to $url on the click event fired on $element and pass the parameters $params
173
	 * Display the result in $responseElement
174
	 * @param string $element
175
	 * @param string $url The url of the request
176
	 * @param string $params The parameters to send
177
	 * @param string $responseElement selector of the HTML element displaying the answer
178
	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"immediatly"=>true)
179
	 */
180
	public function postOnClick($element, $url, $params="{}", $responseElement="", $parameters=array()) {
181
		return $this->postOn("click", $element, $url, $params, $responseElement, $parameters);
182
	}
183
184
	/**
185
	 * Performs a post form with ajax
186
	 * @param string $url The url of the request
187
	 * @param string $form The form HTML id
188
	 * @param string $responseElement selector of the HTML element displaying the answer
189
	 * @param string $jsCallback javascript code to execute after the request
190
	 * @param boolean $hasLoader true for showing ajax loader. default : true
191
	 */
192
	public function postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL,$hasLoader=true) {
193
		return $this->js->_postForm($url, $form, $responseElement, $validation, $jsCallback, NULL, $hasLoader,true);
194
	}
195
196
	/**
197
	 * Performs a delayed post form with ajax
198
	 * For use on an event
199
	 * @param string $url The url of the request
200
	 * @param string $form The form HTML id
201
	 * @param string $responseElement selector of the HTML element displaying the answer
202
	 * @param string $jsCallback javascript code to execute after the request
203
	 * @param string $attr the html attribute added to the request
204
	 * @param boolean $hasLoader true for showing ajax loader. default : true
205
	 */
206
	public function postFormDeferred($url, $form, $responseElement, $validation=false, $jsCallback=NULL,$attr="id",$hasLoader=true) {
207
		return $this->js->_postForm($url, $form, $responseElement, $validation, $jsCallback, $attr, $hasLoader,false);
208
	}
209
210
	/**
211
	 * Performs a post form with ajax in response to an event $event on $element
212
	 * display the result in $responseElement
213
	 * @param string $event
214
	 * @param string $element
215
	 * @param string $url
216
	 * @param string $form
217
	 * @param string $responseElement selector of the HTML element displaying the answer
218
	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"immediatly"=>true)
219
	 */
220
	public function postFormOn($event, $element, $url, $form, $responseElement="", $parameters=array()) {
221
		return $this->js->_postFormOn($event,$element, $url, $form, $responseElement, $parameters);
222
	}
223
224
	/**
225
	 * Performs a post form with ajax in response to the click event on $element
226
	 * display the result in $responseElement
227
	 * @param string $element
228
	 * @param string $url
229
	 * @param string $form
230
	 * @param string $responseElement selector of the HTML element displaying the answer
231
	 * @param array $parameters default : array("preventDefault"=>true,"stopPropagation"=>true,"validation"=>false,"jsCallback"=>NULL,"attr"=>"id","hasLoader"=>true,"immediatly"=>true)
232
	 */
233
	public function postFormOnClick($element, $url, $form, $responseElement="", $parameters=array()) {
234
		return $this->postFormOn("click", $element, $url, $form, $responseElement, $parameters);
235
	}
236
}