Issues (731)

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.

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
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 19 and the first side effect is on line 92.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/**
3
 * @author Niels A.D.
4
 * @author Todd Burry <[email protected]>
5
 * @copyright 2010 Niels A.D., 2014 Todd Burry
6
 * @license http://opensource.org/licenses/LGPL-2.1 LGPL-2.1
7
 * @package pQuery
8
 */
9
10
use pQuery\Html5Parser;
11
use pQuery\HtmlFormatter;
12
13
/**
14
 * Returns HTML DOM from string
15
 * @param string $str
16
 * @param bool $return_root Return root node or return parser object
17
 * @return Html5Parser|DomNode
18
 */
19
function str_get_dom($str, $return_root = true) {
20
	$a = new Html5Parser($str);
21
	return (($return_root) ? $a->root : $a);
22
}
23
24
/**
25
 * Returns HTML DOM from file/website
26
 * @param string $str
27
 * @param bool $return_root Return root node or return parser object
28
 * @param bool $use_include_path Use include path search in file_get_contents
29
 * @param resource $context Context resource used in file_get_contents (PHP >= 5.0.0)
30
 * @return Html5Parser|DomNode
31
 */
32
function file_get_dom($file, $return_root = true, $use_include_path = false, $context = null) {
33
	if (version_compare(PHP_VERSION, '5.0.0', '>='))
34
		$f = file_get_contents($file, $use_include_path, $context);
35
	else {
36
		if ($context !== null)
37
			trigger_error('Context parameter not supported in this PHP version');
38
		$f = file_get_contents($file, $use_include_path);
39
	}
40
41
	return (($f === false) ? false : str_get_dom($f, $return_root));
42
}
43
44
/**
45
 * Format/beautify DOM
46
 * @param DomNode $root
47
 * @param array $options Extra formatting options {@link Formatter::$options}
48
 * @return bool
49
 */
50
function dom_format(&$root, $options = array()) {
51
	$formatter = new HtmlFormatter($options);
52
	return $formatter->format($root);
53
}
54
55
if (version_compare(PHP_VERSION, '5.0.0', '<')) {
56
	/**
57
	 * PHP alternative to str_split, for backwards compatibility
58
	 * @param string $string
59
	 * @return string
60
	 */
61
	function str_split($string) {
62
		$res = array();
63
		$size = strlen($string);
64
		for ($i = 0; $i < $size; $i++) {
65
			$res[] = $string[$i];
66
		}
67
68
		return $res;
69
	}
70
}
71
72
if (version_compare(PHP_VERSION, '5.2.0', '<')) {
73
	/**
74
	 * PHP alternative to array_fill_keys, for backwards compatibility
75
	 * @param array $keys
76
	 * @param mixed $value
77
	 * @return array
78
	 */
79
	function array_fill_keys($keys, $value) {
80
		$res = array();
81
		foreach($keys as $k) {
82
			$res[$k] = $value;
83
		}
84
85
		return $res;
86
	}
87
}
88
89
#!! <- Ignore when converting to single file
90
if (!defined('GANON_NO_INCLUDES')) {
91
	define('GANON_NO_INCLUDES', true);
92
    include_once('IQuery.php');
93
	include_once('gan_tokenizer.php');
94
	include_once('gan_parser_html.php');
95
	include_once('gan_node_html.php');
96
	include_once('gan_selector_html.php');
97
	include_once('gan_formatter.php');
98
}
99
#!
100
101
?>