Issues (2873)

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.

classes/fields/html.php (3 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
 * @package Pods\Fields
5
 */
6
class PodsField_HTML extends PodsField {
7
8
	/**
9
	 * {@inheritdoc}
10
	 */
11
	public static $group = 'Layout Blocks';
12
13
	/**
14
	 * {@inheritdoc}
15
	 */
16
	public static $type = 'html';
17
18
	/**
19
	 * {@inheritdoc}
20
	 */
21
	public static $label = 'HTML';
22
23
	/**
24
	 * {@inheritdoc}
25
	 */
26
	public static $prepare = '%s';
27
28
	/**
29
	 * {@inheritdoc}
30
	 */
31
	public function setup() {
32
33
		self::$label = __( 'HTML', 'pods' );
34
	}
35
36
	/**
37
	 * {@inheritdoc}
38
	 */
39
	public function options() {
40
41
		$options = array(
42
			'output_options' => array(
43
				'label' => __( 'Output Options', 'pods' ),
44
				'group' => array(
45
					static::$type . '_allow_html'      => array(
46
						'label'      => __( 'Allow HTML?', 'pods' ),
47
						'default'    => 1,
48
						'type'       => 'boolean',
49
						'dependency' => true,
50
					),
51
					static::$type . '_oembed'          => array(
52
						'label'   => __( 'Enable oEmbed?', 'pods' ),
53
						'default' => 0,
54
						'type'    => 'boolean',
55
						'help'    => array(
56
							__( 'Embed videos, images, tweets, and other content.', 'pods' ),
57
							'http://codex.wordpress.org/Embeds',
58
						),
59
					),
60
					static::$type . '_wptexturize'     => array(
61
						'label'   => __( 'Enable wptexturize?', 'pods' ),
62
						'default' => 1,
63
						'type'    => 'boolean',
64
						'help'    => array(
65
							__( 'Transforms less-beautfiul text characters into stylized equivalents.', 'pods' ),
66
							'http://codex.wordpress.org/Function_Reference/wptexturize',
67
						),
68
					),
69
					static::$type . '_convert_chars'   => array(
70
						'label'   => __( 'Enable convert_chars?', 'pods' ),
71
						'default' => 1,
72
						'type'    => 'boolean',
73
						'help'    => array(
74
							__( 'Converts text into valid XHTML and Unicode', 'pods' ),
75
							'http://codex.wordpress.org/Function_Reference/convert_chars',
76
						),
77
					),
78
					static::$type . '_wpautop'         => array(
79
						'label'   => __( 'Enable wpautop?', 'pods' ),
80
						'default' => 1,
81
						'type'    => 'boolean',
82
						'help'    => array(
83
							__( 'Changes double line-breaks in the text into HTML paragraphs.', 'pods' ),
84
							'http://codex.wordpress.org/Function_Reference/wpautop',
85
						),
86
					),
87
					static::$type . '_allow_shortcode' => array(
88
						'label'      => __( 'Allow Shortcodes?', 'pods' ),
89
						'default'    => 0,
90
						'type'       => 'boolean',
91
						'dependency' => true,
92
						'help'       => array(
93
							__( 'Embed [shortcodes] that help transform your static content into dynamic content.', 'pods' ),
94
							'http://codex.wordpress.org/Shortcode_API',
95
						),
96
					),
97
				),
98
			),
99
		);
100
101
		return $options;
102
	}
103
104
	/**
105
	 * {@inheritdoc}
106
	 */
107
	public function schema( $options = null ) {
108
109
		return false;
110
	}
111
112
	/**
113
	 * {@inheritdoc}
114
	 */
115
	public function display( $value = null, $name = null, $options = null, $pod = null, $id = null ) {
0 ignored issues
show
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
116
117
		$value = $this->strip_html( $value, $options );
118
119
		if ( 1 === (int) pods_v( static::$type . '_oembed', $options, 0 ) ) {
120
			$embed = $GLOBALS['wp_embed'];
121
			$value = $embed->run_shortcode( $value );
122
			$value = $embed->autoembed( $value );
123
		}
124
125
		if ( 1 === (int) pods_v( static::$type . '_wptexturize', $options, 1 ) ) {
126
			$value = wptexturize( $value );
127
		}
128
129
		if ( 1 === (int) pods_v( static::$type . '_convert_chars', $options, 1 ) ) {
130
			$value = convert_chars( $value );
131
		}
132
133
		if ( 1 === (int) pods_v( static::$type . '_wpautop', $options, 1 ) ) {
134
			$value = wpautop( $value );
135
		}
136
137
		if ( 1 === (int) pods_v( static::$type . '_allow_shortcode', $options, 0 ) ) {
138
			if ( 1 === (int) pods_v( static::$type . '_wpautop', $options, 1 ) ) {
139
				$value = shortcode_unautop( $value );
140
			}
141
142
			$value = do_shortcode( $value );
143
		}
144
145
		return $value;
146
	}
147
148
	/**
149
	 * {@inheritdoc}
150
	 */
151
	public function input( $name, $value = null, $options = null, $pod = null, $id = null ) {
152
153
		$options = (array) $options;
154
155
		// @codingStandardsIgnoreLine
156
		echo $this->display( $value, $name, $options, $pod, $id );
157
	}
158
159
	/**
160
	 * {@inheritdoc}
161
	 */
162
	public function ui( $id, $value, $name = null, $options = null, $fields = null, $pod = null ) {
0 ignored issues
show
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
This method's name is shorter than the configured minimum length of 3 characters.

Even though PHP does not care about the name of your methods, it is generally a good practice to choose method names which can be easily understood by other human readers.

Loading history...
163
164
		$value = $this->strip_html( $value, $options );
165
166
		$value = wp_trim_words( $value );
167
168
		return $value;
169
	}
170
}
171