Issues (21)

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.

classes/CodeReview/CodeFixer.php (1 issue)

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
namespace CodeReview;
3
4
class CodeFixer {
5
6
	/**
7
	 * Just basic function renames from A to B
8
	 *
9
	 * @param string $maxVersion Maximum Elgg version to support
10
	 * @return array
11
	 */
12 9
	public function getBasicFunctionRenames($maxVersion = '') {
13
		$data = array(
14
			'1.7' => array(
15 9
				'elgg_validate_action_url' => 'elgg_add_action_tokens_to_url',
16 9
				'menu_item' => 'make_register_object',
17 9
				'extend_view' => 'elgg_extend_view',
18 9
				'get_views' => 'elgg_get_views',
19 9
			),
20
			'1.8' => array(
21 9
				'register_elgg_event_handler' => 'elgg_register_event_handler',
22 9
				'unregister_elgg_event_handler' => 'elgg_unregister_event_handler',
23 9
				'trigger_elgg_event' => 'elgg_trigger_event',
24 9
				'register_plugin_hook' => 'elgg_register_plugin_hook_handler',
25 9
				'unregister_plugin_hook' => 'elgg_unregister_plugin_hook_handler',
26 9
				'trigger_plugin_hook' => 'elgg_trigger_plugin_hook',
27 9
				'friendly_title' => 'elgg_get_friendly_title',
28 9
				'friendly_time' => 'elgg_view_friendly_time',
29 9
				'page_owner' => 'elgg_get_page_owner_guid',
30 9
				'page_owner_entity' => 'elgg_get_page_owner_entity',
31 9
				'set_page_owner' => 'elgg_set_page_owner_guid',
32 9
				'set_context' => 'elgg_set_context',
33 9
				'get_context' => 'elgg_get_context',
34 9
				'get_plugin_name' => 'elgg_get_calling_plugin_id',
35 9
				'is_plugin_enabled' => 'elgg_is_active_plugin',
36 9
				'set_user_validation_status' => 'elgg_set_user_validation_status',
37 9
				'get_loggedin_user' => 'elgg_get_logged_in_user_entity',
38 9
				'get_loggedin_userid' => 'elgg_get_logged_in_user_guid',
39 9
				'isloggedin' => 'elgg_is_logged_in',
40 9
				'isadminloggedin' => 'elgg_is_admin_logged_in',
41 9
				'load_plugins' => '_elgg_load_plugins',
42 9
				'set_plugin_usersetting' => 'elgg_set_plugin_user_setting',
43 9
				'clear_plugin_usersetting' => 'elgg_unset_plugin_user_setting',
44 9
				'get_plugin_usersetting' => 'elgg_get_plugin_user_setting',
45 9
				'set_plugin_setting' => 'elgg_set_plugin_setting',
46 9
				'get_plugin_setting' => 'elgg_get_plugin_setting',
47 9
				'clear_plugin_setting' => 'elgg_unset_plugin_setting',
48 9
				'clear_all_plugin_settings' => 'elgg_unset_all_plugin_settings',
49 9
				'set_view_location' => 'elgg_set_view_location',
50 9
				'get_metadata' => 'elgg_get_metadata_from_id',
51 9
				'get_annotation' => 'elgg_get_annotation_from_id',
52 9
				'register_page_handler' => 'elgg_register_page_handler',
53 9
				'unregister_page_handler' => 'elgg_unregister_page_handler',
54 9
				'register_entity_type' => 'elgg_register_entity_type',
55 9
				'elgg_view_register_simplecache' => 'elgg_register_simplecache_view',
56 9
				'elgg_view_regenerate_simplecache' => 'elgg_regenerate_simplecache',
57 9
				'elgg_view_enable_simplecache' => 'elgg_enable_simplecache',
58 9
				'elgg_view_disable_simplecache' => 'elgg_disable_simplecache',
59 9
				'remove_widget_type' => 'elgg_unregister_widget_type',
60 9
				'widget_type_exists' => 'elgg_is_widget_type',
61 9
				'get_widget_types' => 'elgg_get_widget_types',
62 9
				'display_widget' => 'elgg_view_entity',
63 9
				'invalidate_cache_for_entity' => '_elgg_invalidate_cache_for_entity',
64 9
				'cache_entity' => '_elgg_cache_entity',
65 9
				'retrieve_cached_entity' => '_elgg_retrieve_cached_entity',
66 9
			),
67
			'1.9' => array(
68 9
				'setup_db_connections' => '_elgg_services()->db->setupConnections',
69 9
				'get_db_link' => '_elgg_services()->db->getLink',
70 9
				'get_db_error' => 'mysql_error',
71 9
				'execute_delayed_query' => '_elgg_services()->db->registerDelayedQuery',
72 9
				'elgg_regenerate_simplecache' => 'elgg_invalidate_simplecache',
73 9
				'elgg_get_filepath_cache' => 'elgg_get_system_cache',
74 9
				'elgg_filepath_cache_reset' => 'elgg_reset_system_cache',
75 9
				'elgg_filepath_cache_save' => 'elgg_save_system_cache',
76 9
				'elgg_filepath_cache_load' => 'elgg_load_system_cache',
77 9
				'elgg_enable_filepath_cache' => 'elgg_enable_system_cache',
78 9
				'elgg_disable_filepath_cache' => 'elgg_disable_system_cache',
79 9
				'unregister_entity_type' => 'elgg_unregister_entity_type',
80 9
				'autop' => 'elgg_autop',
81 9
				'xml_to_object' => 'new ElggXMLElement',
82 9
				'unregister_notification_handler' => 'elgg_unregister_notification_method',
83 9
			),
84
			'1.10' => array(
85 9
				'file_get_general_file_type' => 'elgg_get_file_simple_type',
86 9
				'file_get_simple_type' => 'elgg_get_file_simple_type',
87 9
			),
88 9
		);
89
90 9
		$result = array();
91 9
		foreach ($data as $version => $rows) {
92 9
			if (!$maxVersion || version_compare($version, $maxVersion, '<=')) {
93 1
				$result = array_merge($result, $rows);
94 1
			}
95 9
		}
96 9
		return $result;
97
	}
98
99
	/**
100
	 * Function renames from A to B with parameters manipulation
101
	 *
102
	 * @return array
103
	 */
104
	public function getBasicFunctionSnippets() {
105
		return array(
106
			'elgg_get_entity_owner_where_sql' => '_elgg_get_guid_based_where_sql',
107
			'elgg_get_entity_container_where_sql' => '_elgg_get_guid_based_where_sql',
108
			'elgg_get_entity_site_where_sql' => '_elgg_get_guid_based_where_sql',
109
110
//			'get_entities_from_access_id' => 'elgg_get_entities_from_access_id', //bad params count
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
111
//			'get_entities_from_annotations' => 'elgg_get_entities_from_annotations',//bad params count
112
//			'list_entities_from_annotations' => 'elgg_list_entities_from_annotations',//bad params count
113
//			'get_library_files' => 'elgg_get_file_list',//bad params count
114
//			'get_entities' => 'elgg_get_entities',//bad params count
115
//			'list_registered_entities' => 'elgg_list_registered_entities',//bad params count
116
//			'list_entities' => 'elgg_list_entities',//bad params count
117
//			'get_entities_from_metadata' => 'elgg_get_entities_from_metadata',//bad params count
118
//			'get_entities_from_metadata_multi' => 'elgg_get_entities_from_metadata',//bad params count
119
//			'get_entities_from_relationship' => 'elgg_get_entities_from_relationship',//bad params count
120
//			'make_register_object' => 'add_submenu_item',//bad params count
121
//			'list_entities_from_access_id' => 'elgg_list_entities_from_access_id',//bad params count
122
//			'register_action' => 'elgg_register_action',//bad params count
123
//			'get_entities_from_annotations_calculate_x' => 'elgg_get_entities_from_annotation_calculation',//bad params count
124
//			'get_entities_from_annotation_count' => 'elgg_get_entities_from_annotation_calculation',//bad params count
125
//			'list_entities_from_annotation_count' => 'elgg_list_entities_from_annotation_calculation',//bad params count
126
//			'get_objects_in_group' => 'elgg_get_entities',//bad params count
127
//			'list_entities_groups' => 'elgg_list_entities',//bad params count
128
//			'get_entities_from_metadata_groups' => 'elgg_get_entities_from_metadata',//bad params count
129
//			'get_entities_from_metadata_groups_multi' => 'elgg_get_entities_from_metadata',//bad params count
130
//			'list_entities_in_area' => 'elgg_get_entities_from_location',//bad params count
131
//			'list_entities_location' => 'elgg_list_entities_from_location',//bad params count
132
//			'get_entities_in_area' => 'elgg_get_entities_from_location',//bad params count
133
//			'list_entities_from_metadata' => 'elgg_list_entities_from_metadata',//bad params count
134
//			'list_entities_from_metadata_multi' => 'elgg_list_entities_from_metadata',//bad params count
135
//			'regenerate_plugin_list' => '_elgg_generate_plugin_entities',//bad params count
136
		);
137
	}
138
139
	/**
140
	 * @return array of
141
	 */
142
	public function getRegExpPairs() {
143
		return array(
144
			'([^_a-zA-Z0-9])register_plugin_hook([^_a-zA-Z0-9])' => '$1elgg_register_plugin_hook_handler$2',
145
		);
146
	}
147
148
	/**
149
	 * We'll need
150
	 * - function renames
151
	 * - function renames with parameter modifications
152
	 * - function replacements with complex snippets
153
	 */
154
}