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.

components/I18n/pods-admin-i18n.js (28 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
;(function ( $ ) {
2
3
	/**
4
	 * Component admin page
5
	 */
6
	PodsAdminI18n = {
0 ignored issues
show
PodsAdminI18n does not seem to be defined.
Loading history...
7
		init : function () {
8
			if ( $( '#pods_i18n_settings_save' ).length ) {
9
				this.initSave();
10
			}
11
		},
12
13
		initSave : function () {
14
			$( document ).on( 'click', '#pods_i18n_settings_save #submit', function () {
15
				$( '#_nonce_i18n' ).appendTo( '.pods-admin form#posts-filter' );
16
17
				$( '.pods-admin form#posts-filter' ).prop( 'method', 'post' ).submit();
18
			} );
19
		}
20
	};
21
22
	if ( $( '#pods_admin_i18n' ).length ) {
23
		PodsAdminI18n.init();
0 ignored issues
show
PodsAdminI18n does not seem to be defined.
Loading history...
24
	}
25
26
	/**
27
	 * Pod edit page
28
	 */
29
	PodsEditI18n = {
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
30
		i18nVisible : true, selector : '.pods-i18n-input', toggleSpeed : 100,
31
32
		init : function () {
33
			this.toggleI18nInputs();
34
			this.dynamicAddRemoveInputs();
35
		},
36
37
		validateI18nVisibility : function () {
38
			/**
39
			 * Check if we're on the fields tab
40
			 * If we're on a fields tab, check if the first i18n input is visible and change this object's visibility property
41
			 */
42
			if ( $( '#pods-manage-fields' ).is( ':visible' ) && $( '#pods-manage-fields .pods-manage-list .pods-manage-row-expanded' ).length ) {
43
				var first = $( '#pods-manage-fields .pods-manage-list .pods-manage-row-expanded' ).first().find( PodsEditI18n.selector ).first();
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
44
				if ( first.is( ':visible' ) ) {
45
					PodsEditI18n.i18nVisible = true;
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
46
				}
47
				else {
48
					PodsEditI18n.i18nVisible = false;
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
49
				}
50
			}
51
52
		},
53
54
		toggleI18nInputs : function () {
55
56
			// Toggle i18n inputs for pod options
57
			// @todo  Enable auto-toggle when opening a field
58
			$( document ).on( 'click', 'button#toggle_i18n', function ( e ) {
59
				e.preventDefault();
60
61
				PodsEditI18n.validateI18nVisibility();
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
62
63
				if ( PodsEditI18n.i18nVisible ) {
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
64
65
					PodsEditI18n.i18nVisible = false;
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
66
					$( PodsEditI18n.selector ).each( function () {
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
67
						$( this ).slideUp( PodsEditI18n.toggleSpeed, function () {
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
68
							// Fallback for hidden fields
69
							$( this ).css( 'display', 'none' );
70
						} );
71
					} );
72
73
				}
74
				else {
75
76
					PodsEditI18n.i18nVisible = true;
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
77
					$( PodsEditI18n.selector ).each( function () {
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
78
						$( this ).slideDown( PodsEditI18n.toggleSpeed, function () {
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
79
							// Fallback for hidden fields
80
							$( this ).css( 'display', 'block' );
81
						} );
82
					} );
83
84
				}
85
				return false;
86
			} );
87
		},
88
89
		dynamicAddRemoveInputs : function () {
90
91
			$( document ).on( 'change', '#pods_i18n .pods-enable-disable-language input', function ( e ) {
92
93
				PodsEditI18n.validateI18nVisibility();
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
94
95
				var locale = $( this ).parents( '.pods-enable-disable-language' ).attr( 'data-locale' );
96
97
				if ( $( this ).is( ':checked' ) ) {
98
99
					// Get the index for this locale
100
					var index = 0;
101
					$( '#pods_i18n .pods-enable-disable-language input:checked' ).each( function () {
102
						if ( $( this ).parents( '.pods-enable-disable-language' ).attr( 'data-locale' ) == locale ) {
0 ignored issues
show
=== was expected, but instead == was given.
Loading history...
103
							return false;
104
						}
105
						index++;
106
					} );
107
108
					$( '.pods-i18n-field' ).each( function () {
109
						if ( $( '.pods-i18n-input-' + locale, this ).length ) {
110
							$( '.pods-i18n-input-' + locale, this ).slideDown( PodsEditI18n.toggleSpeed, function () {
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
111
								$( 'input', this ).removeAttr( 'disabled' );
112
							} );
113
						}
114
						else {
115
							var name = $( this ).parent().children( 'input' ).first().attr( 'name' );
116
							// Place the new input on the right index
117
							if ( $( '.pods-i18n-input:visible', this ).eq( index ).length ) {
118
								$( '.pods-i18n-input:visible', this ).eq( index ).before( PodsEditI18n.i18nInputTemplate( name, locale ) );
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
119
							}
120
							else {
121
								$( this ).append( PodsEditI18n.i18nInputTemplate( name, locale ) );
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
122
							}
123
							if ( PodsEditI18n.i18nVisible ) {
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
124
								$( '.pods-i18n-input-' + locale, this ).slideDown( PodsEditI18n.toggleSpeed );
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
125
							}
126
						}
127
					} );
128
129
				}
130
				else {
131
					$( '.pods-i18n-input-' + locale + ' input' ).each( function () {
132
						$( this ).parent().slideUp( PodsEditI18n.toggleSpeed, function () {
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
133
							$( 'input', this ).attr( 'disabled', 'disabled' );
134
						} );
135
					} );
136
				}
137
138
			} );
139
140
		},
141
142
		i18nInputTemplate : function ( name, locale ) {
143
144
			var locale_clean = locale.toLowerCase().replace( '_', '-' );
145
			var name_clean = name.toLowerCase().replace( '_', '-' );
146
147
			html = '<div class="pods-i18n-input pods-i18n-input-' + locale + '" data-locale="' + locale + '" style="display: none;">';
0 ignored issues
show
html does not seem to be defined.
Loading history...
148
			html += '<label class="pods-form-ui-label" for="pods-form-ui-label-' + locale_clean + '"><small><code style="font-size: 1em;">' + locale + '</code></small></label>';
0 ignored issues
show
html does not seem to be defined.
Loading history...
149
			html += '<input name="' + name + '_' + locale + '" data-name-clean="' + name_clean + '-' + locale_clean + '" id="pods-form-ui-label-' + locale_clean + '" class="pods-form-ui-field pods-form-ui-field-type-text pods-form-ui-field-name-' + name_clean + '-' + locale_clean + '" type="text" value="" tabindex="2" maxlength="255">';
0 ignored issues
show
html does not seem to be defined.
Loading history...
150
			html += '</div>';
0 ignored issues
show
html does not seem to be defined.
Loading history...
151
			return html;
0 ignored issues
show
html does not seem to be defined.
Loading history...
152
		}
153
154
	};
155
156
	if ( $( '#post-body' ).length ) {
157
		PodsEditI18n.init();
0 ignored issues
show
PodsEditI18n does not seem to be defined.
Loading history...
158
	}
159
160
})( jQuery );
161