Issues (461)

Branch: master

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

includes/classes/class-lsx-nav-walker.php (12 issues)

1
<?php
2
/**
3
 * LSX functions and definitions - Navigation Walker.
4
 *
5
 * @package    lsx
6
 * @subpackage navigation
7
 * @category   bootstrap-walker
8
 */
9
10
if ( ! defined( 'ABSPATH' ) ) {
11
	exit;
12
}
13
14
if ( ! class_exists( 'Walker_Nav_Menu' ) ) {
15
	return;
16
}
17
18
if ( ! class_exists( 'LSX_Nav_Walker' ) ) :
19
20
	/**
21
	 * Cleaner walker for wp_nav_menu()
22
	 *
23
	 * Walker_Nav_Menu (WordPress default) example output:
24
	 *   <li id="menu-item-8" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-8"><a href="/">Home</a></li>
25
	 *   <li id="menu-item-9" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-9"><a href="/sample-page/">Sample Page</a></l
26
	 *
27
	 * LSX_Nav_Walker example output:
28
	 *   <li class="menu-home"><a href="/">Home</a></li>
29
	 *   <li class="menu-sample-page"><a href="/sample-page/">Sample Page</a></li>
30
	 *
31
	 * @package    lsx
32
	 * @subpackage navigation
33
	 * @category   bootstrap-walker
34
	 */
35
	class LSX_Nav_Walker extends Walker_Nav_Menu {
36
37
		function check_current( $classes ) {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
Coding Style Documentation introduced by
Missing doc comment for function check_current()
Loading history...
Comprehensibility Best Practice introduced by
It is recommend to declare an explicit visibility for check_current.

Generally, we recommend to declare visibility for all methods in your source code. This has the advantage of clearly communication to other developers, and also yourself, how this method should be consumed.

If you are not sure which visibility to choose, it is a good idea to start with the most restrictive visibility, and then raise visibility as needed, i.e. start with private, and only raise it to protected if a sub-class needs to have access, or public if an external class needs access.

Loading history...
38
			return preg_match( '/^(current[-_])|active|dropdown$/', $classes );
39
		}
40
41
		function start_lvl( &$output, $depth = 0, $args = array() ) {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
Coding Style Documentation introduced by
Missing doc comment for function start_lvl()
Loading history...
Comprehensibility Best Practice introduced by
It is recommend to declare an explicit visibility for start_lvl.

Generally, we recommend to declare visibility for all methods in your source code. This has the advantage of clearly communication to other developers, and also yourself, how this method should be consumed.

If you are not sure which visibility to choose, it is a good idea to start with the most restrictive visibility, and then raise visibility as needed, i.e. start with private, and only raise it to protected if a sub-class needs to have access, or public if an external class needs access.

Loading history...
42
			$output .= "\n<ul class=\"dropdown-menu\">\n";
43
		}
44
45
		function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
Coding Style Documentation introduced by
Missing doc comment for function start_el()
Loading history...
Comprehensibility Best Practice introduced by
It is recommend to declare an explicit visibility for start_el.

Generally, we recommend to declare visibility for all methods in your source code. This has the advantage of clearly communication to other developers, and also yourself, how this method should be consumed.

If you are not sure which visibility to choose, it is a good idea to start with the most restrictive visibility, and then raise visibility as needed, i.e. start with private, and only raise it to protected if a sub-class needs to have access, or public if an external class needs access.

Loading history...
46
			$item_html = '';
47
48
			if ( isset( $item->title ) ) {
49
				parent::start_el( $item_html, $item, $depth, $args );
50
51
				if ( $item->is_dropdown && ( 0 === $depth ) ) {
52
					$item_html = str_replace( '<a', '<a class="dropdown-toggle" data-target="#"', $item_html );
53
					$item_html = str_replace( '</a>', ' <b class="caret"></b></a>', $item_html );
54
				} elseif ( stristr( $item_html, 'li class="divider"' ) ) {
55
					$item_html = preg_replace( '/<a[^>]*>.*?<\/a>/iU', '', $item_html );
56
				} elseif ( stristr( $item_html, 'li class="dropdown-header"' ) ) {
57
					$item_html = preg_replace( '/<a[^>]*>(.*)<\/a>/iU', '$1', $item_html );
58
				}
59
60
				$item_html = apply_filters( 'lsx_wp_nav_menu_item', $item_html );
61
				$output   .= $item_html;
62
			}
63
		}
64
65
		function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) {
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
Coding Style Documentation introduced by
Missing doc comment for function display_element()
Loading history...
Comprehensibility Best Practice introduced by
It is recommend to declare an explicit visibility for display_element.

Generally, we recommend to declare visibility for all methods in your source code. This has the advantage of clearly communication to other developers, and also yourself, how this method should be consumed.

If you are not sure which visibility to choose, it is a good idea to start with the most restrictive visibility, and then raise visibility as needed, i.e. start with private, and only raise it to protected if a sub-class needs to have access, or public if an external class needs access.

Loading history...
66
			$element->is_dropdown = ( ( ! empty( $children_elements[ $element->ID ] ) && ( ( $depth + 1 ) < $max_depth || ( 0 === $max_depth ) ) ) );
67
68
			if ( $element->is_dropdown ) {
69
				if ( $depth > 0 ) {
70
					$element->classes[] = 'dropdown-submenu';
71
				} else {
72
					$element->classes[] = 'dropdown';
73
				}
74
			}
75
76
			parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
77
		}
78
79
	}
80
81
endif;
82