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.

ui/js/pods-link-picker.js (12 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
// JavaScript Document
2
3
jQuery(document).ready(function($){
4
5
	var podsLink = {
6
		wpLinkDefaults: null,
7
		activeLinkPicker: null,
8
		init: function() {
9
			
10
			// Open wpLink modal
11
			$(document).on('click', '.pods-field .podsLinkPopup', function (e) {
12
				// Store current field pointer
13
				podsLink.activeLinkPicker = $(this).parents('.pods-link-options');
14
				$('body').addClass('modal-open-pods-field-link');
15
16
				var url_elem = podsLink.activeLinkPicker.find('.linkPickerUrl');
17
				var text_elem = podsLink.activeLinkPicker.find('.linkPickerText');
18
				var target_elem = podsLink.activeLinkPicker.find('.linkPickerTarget');
19
20
				wpLink.setDefaultValues = function() {
0 ignored issues
show
wpLink does not seem to be defined.
Loading history...
21
					$('#wp-link-wrap #wp-link-url').val( url_elem.val() );
22
					$('#wp-link-wrap #wp-link-text').val( text_elem.val() );
23
					if ( target_elem.is(':checked') ) {
24
						$('#wp-link-wrap #wp-link-target').prop('checked', true);
25
					} else {
26
						$('#wp-link-wrap #wp-link-target').prop('checked', false);
27
					}
28
				};
29
30
		        // save any existing default initialization
31
		        podsLink.wpLinkDefaults = wpLink.setDefaultValues;
0 ignored issues
show
wpLink does not seem to be defined.
Loading history...
32
33
				// Open modal in the dummy textarea
34
				wpLink.open( 'pods-link-editor-hidden' );
0 ignored issues
show
wpLink does not seem to be defined.
Loading history...
35
36
				return false;
37
			});
38
			
39
			// Save changes in the selected field
40
			$(document).on('click', '#wp-link-submit', function(event) {
41
42
				// Is the wpLink modal open?
43
				if ($('body').hasClass('modal-open-pods-field-link')) {
44
					//get the href attribute and add to a textfield, or use as you see fit
45
					//the links attributes (href, target) are stored in an object, which can be access via  wpLink.getAttrs()
46
					var linkAtts = wpLink.getAttrs();
0 ignored issues
show
wpLink does not seem to be defined.
Loading history...
47
					if (linkAtts.href != '') {
0 ignored issues
show
!== was expected, but instead != was given.
Loading history...
48
						podsLink.activeLinkPicker.find('.linkPickerUrl').val(linkAtts.href);
49
					}
50
					//get the target attribute
51
					if (linkAtts.target == '_blank') {
0 ignored issues
show
=== was expected, but instead == was given.
Loading history...
52
						podsLink.activeLinkPicker.find('.linkPickerTarget').prop('checked', true);
53
					} else {
54
						podsLink.activeLinkPicker.find('.linkPickerTarget').prop('checked', false);
55
					}
56
					//get the text attribute
57
					var linkText = $('#wp-link-wrap #wp-link-text').val();
58
					if (linkText != '') {
0 ignored issues
show
!== was expected, but instead != was given.
Loading history...
59
						podsLink.activeLinkPicker.find('.linkPickerText').val(linkText);
60
					}
61
				}
62
63
				// Reset wpLink modal
64
				podsLink.resetLink();
65
66
				//trap any events
67
				event.preventDefault ? event.preventDefault() : event.returnValue = false;
0 ignored issues
show
Did you forget to assign or call a function?

This error message can for example pop up if you forget to assign the result of a function call to a variable or pass it to another function:

function someFunction(x) {
    (x > 0) ? callFoo() : callBar();
}

// JSHint expects you to assign the result to a variable:
function someFunction(x) {
    var rs = (x > 0) ? callFoo() : callBar();
}

// If you do not use the result, you could also use if statements in the
// case above.
function someFunction(x) {
    if (x > 0) {
        callFoo();
    } else {
        callBar();
    }
}
Loading history...
68
				event.stopPropagation();
69
				return false;
70
			});
71
			
72
			// Close modal without any changes
73
			$(document).on('click', '#wp-link-cancel, #wp-link-close', function(event) {
74
75
				// Reset wpLink modal
76
				podsLink.resetLink();
77
78
				//trap any events
79
				event.preventDefault ? event.preventDefault() : event.returnValue = false;
0 ignored issues
show
Did you forget to assign or call a function?

This error message can for example pop up if you forget to assign the result of a function call to a variable or pass it to another function:

function someFunction(x) {
    (x > 0) ? callFoo() : callBar();
}

// JSHint expects you to assign the result to a variable:
function someFunction(x) {
    var rs = (x > 0) ? callFoo() : callBar();
}

// If you do not use the result, you could also use if statements in the
// case above.
function someFunction(x) {
    if (x > 0) {
        callFoo();
    } else {
        callBar();
    }
}
Loading history...
80
				event.stopPropagation();
81
				return false;
82
			});	
83
84
		},
85
	    resetLink: function() {
86
	    	$('body').removeClass('modal-open-pods-field-link');
87
	        wpLink.textarea = $('body'); // to close the link dialogue, it is again expecting an wp_editor instance, so you need to give it something to set focus back to. In this case, I'm using body, but the textfield with the URL would be fine
0 ignored issues
show
wpLink does not seem to be defined.
Loading history...
88
	        wpLink.close();// close the dialogue
0 ignored issues
show
wpLink does not seem to be defined.
Loading history...
89
90
	        // restore wplink default initialization
91
	        wpLink.setDefaultValues = podsLink.wpLinkDefaults;
0 ignored issues
show
wpLink does not seem to be defined.
Loading history...
92
	    }
93
	};
94
95
	// Validate that we have the right resourses
96
	if ( typeof wpLink !== 'undefined' && $('#wp-link-wrap').length ) {
97
		$('.pods-field .link-existing-content').show();
98
		podsLink.init();
99
	}
100
});
101
102