Issues (4069)

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.

include/Smarty/plugins/function.sugarvar.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
3
/*
4
5
Modification information for LGPL compliance
6
7
r57851 - 2010-08-20 12:44:11 -0700 (Fri, 20 Aug 2010) - kjing - Author: Jenny Gonsalves <[email protected]>
8
    Merging with maint_6_0_1 revisions 57708:57838
9
10
r56990 - 2010-06-16 13:05:36 -0700 (Wed, 16 Jun 2010) - kjing - snapshot "Mango" svn branch to a new one for GitHub sync
11
12
r56989 - 2010-06-16 13:01:33 -0700 (Wed, 16 Jun 2010) - kjing - defunt "Mango" svn dev branch before github cutover
13
14
r56965 - 2010-06-15 10:57:35 -0700 (Tue, 15 Jun 2010) - jenny - Merging with Windex 56827:56958
15
16
r55980 - 2010-04-19 13:31:28 -0700 (Mon, 19 Apr 2010) - kjing - create Mango (6.1) based on windex
17
18
r52439 - 2009-11-12 17:05:52 -0800 (Thu, 12 Nov 2009) - clee - Updated to allow Rich Text Editor to resize and render HTML content on detailview.
19
20
r51719 - 2009-10-22 10:18:00 -0700 (Thu, 22 Oct 2009) - mitani - Converted to Build 3  tags and updated the build system 
21
22
r51634 - 2009-10-19 13:32:22 -0700 (Mon, 19 Oct 2009) - mitani - Windex is the branch for Sugar Sales 1.0 development
23
24
r50375 - 2009-08-24 18:07:43 -0700 (Mon, 24 Aug 2009) - dwong - branch kobe2 from tokyo r50372
25
26
r42807 - 2008-12-29 11:16:59 -0800 (Mon, 29 Dec 2008) - dwong - Branch from trunk/sugarcrm r42806 to branches/tokyo/sugarcrm
27
28
r30629 - 2007-12-26 08:01:12 -0800 (Wed, 26 Dec 2007) - clee - Changed SugarFieldText.php to automatically set the smarty modifier url2html to be true for DetailViews.  Changed function.sugarvar.php to check for this modifier and render the appropriate call to the smarty modifier.
29
Modified:
30
include/SugarFields/Text/SugarFieldText.php
31
include/Smarty/plugins/function.sugarvar.php
32
33
r23083 - 2007-05-24 16:39:44 -0700 (Thu, 24 May 2007) - clee - Code cleanup.
34
35
r22459 - 2007-05-02 04:44:56 -0700 (Wed, 02 May 2007) - majed - adds new field types as well as improving meta data driven ui support
36
37
r22239 - 2007-04-24 17:22:11 -0700 (Tue, 24 Apr 2007) - clee - Support for nested memberName attribute value (for relate fields)
38
39
r22184 - 2007-04-23 17:47:51 -0700 (Mon, 23 Apr 2007) - clee - Latest updates as we continue 5.0 framework development.
40
41
r22175 - 2007-04-23 16:43:00 -0700 (Mon, 23 Apr 2007) - clee - Latest updates as we continue 5.0 framework development.
42
43
r22125 - 2007-04-20 17:02:26 -0700 (Fri, 20 Apr 2007) - majed - makes it so you don't need to pass in as many variables
44
45
r22124 - 2007-04-20 16:54:53 -0700 (Fri, 20 Apr 2007) - clee - 
46
47
*/
48
49
50
/**
51
 * Smarty plugin
52
 * @package Smarty
53
 * @subpackage plugins
54
 */
55
56
57
/**
58
 * Smarty {sugarvar} function plugin
59
 *
60
 * Type:     function<br>
61
 * Name:     sugarvar<br>
62
 * Purpose:  creates a smarty variable from the parameters
63
 *
64
 * @author Wayne Pan {wayne at sugarcrm.com}
65
 * @param array
66
 * @param Smarty
67
 */
68
69 1
function smarty_function_sugarvar($params, &$smarty)
70
{
71 4
	if(empty($params['key']))  {
72
	    $smarty->trigger_error("sugarvar: missing 'key' parameter");
73
	    return;
74
	}
75
76 4
	$object = (empty($params['objectName']))?$smarty->get_template_vars('parentFieldArray'): $params['objectName'];
77 4
	$displayParams = $smarty->get_template_vars('displayParams');
78
79
80 4
	if(empty($params['memberName'])){
81 4
		$member = $smarty->get_template_vars('vardef');
82 4
		$member = $member['name'];
83
	}else{
84 4
		$members = explode('.', $params['memberName']);
85 4
		$member =  $smarty->get_template_vars($members[0]);
86 4
		for($i = 1; $i < count($members); $i++){
0 ignored issues
show
Performance Best Practice introduced by
It seems like you are calling the size function count() as part of the test condition. You might want to compute the size beforehand, and not on each iteration.

If the size of the collection does not change during the iteration, it is generally a good practice to compute it beforehand, and not on each iteration:

for ($i=0; $i<count($array); $i++) { // calls count() on each iteration
}

// Better
for ($i=0, $c=count($array); $i<$c; $i++) { // calls count() just once
}
Loading history...
87 4
			$member = $member[$members[$i]];
88
		}
89
	}
90
91 4
    $_contents =  '$'. $object . '.' . $member . '.' . $params['key'];
92 4
	if(empty($params['stringFormat']) && empty($params['string'])) {
93 4
		$_contents = '{' . $_contents;
94 4
		if(!empty($displayParams['htmlescape'])){
95 1
			$_contents .= '|escape:\'html\'';
96
		}
97 4
		if(!empty($params['htmlentitydecode'])){
98 1
			$_contents .= '|escape:\'html_entity_decode\'';
99
		}
100 4
		if(!empty($displayParams['strip_tags'])){
101
			$_contents .= '|strip_tags';
102
		}
103 4
		if(!empty($displayParams['url2html'])){
104 1
			$_contents .= '|url2html';
105
		}
106 4
		if(!empty($displayParams['nl2br'])){
107 1
			$_contents .= '|nl2br';
108
		}
109
110 4
		$_contents .= '}';
111
    }
112 4
    return $_contents;
113 1
}
114
?>
115