This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | if (! defined ( 'sugarEntry' ) || ! sugarEntry) |
||
3 | die ( 'Not A Valid Entry Point' ) ; |
||
4 | /********************************************************************************* |
||
5 | * SugarCRM Community Edition is a customer relationship management program developed by |
||
6 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
||
7 | |||
8 | * SuiteCRM is an extension to SugarCRM Community Edition developed by Salesagility Ltd. |
||
9 | * Copyright (C) 2011 - 2014 Salesagility Ltd. |
||
10 | * |
||
11 | * This program is free software; you can redistribute it and/or modify it under |
||
12 | * the terms of the GNU Affero General Public License version 3 as published by the |
||
13 | * Free Software Foundation with the addition of the following permission added |
||
14 | * to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK |
||
15 | * IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY |
||
16 | * OF NON INFRINGEMENT OF THIRD PARTY RIGHTS. |
||
17 | * |
||
18 | * This program is distributed in the hope that it will be useful, but WITHOUT |
||
19 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
||
20 | * FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more |
||
21 | * details. |
||
22 | * |
||
23 | * You should have received a copy of the GNU Affero General Public License along with |
||
24 | * this program; if not, see http://www.gnu.org/licenses or write to the Free |
||
25 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
||
26 | * 02110-1301 USA. |
||
27 | * |
||
28 | * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road, |
||
29 | * SW2-130, Cupertino, CA 95014, USA. or at email address [email protected]. |
||
30 | * |
||
31 | * The interactive user interfaces in modified source and object code versions |
||
32 | * of this program must display Appropriate Legal Notices, as required under |
||
33 | * Section 5 of the GNU Affero General Public License version 3. |
||
34 | * |
||
35 | * In accordance with Section 7(b) of the GNU Affero General Public License version 3, |
||
36 | * these Appropriate Legal Notices must retain the display of the "Powered by |
||
37 | * SugarCRM" logo and "Supercharged by SuiteCRM" logo. If the display of the logos is not |
||
38 | * reasonably feasible for technical reasons, the Appropriate Legal Notices must |
||
39 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
||
40 | ********************************************************************************/ |
||
41 | |||
42 | |||
43 | require_once ('modules/DynamicFields/DynamicField.php') ; |
||
44 | |||
45 | class StandardField extends DynamicField |
||
46 | { |
||
47 | var $custom_def = array(); |
||
48 | var $base_def = array(); |
||
49 | var $baseField; |
||
50 | |||
51 | protected function loadCustomDef($field){ |
||
52 | global $beanList; |
||
53 | if (!empty($beanList[$this->module]) && is_file("custom/Extension/modules/{$this->module}/Ext/Vardefs/sugarfield_$field.php")) |
||
54 | { |
||
55 | $bean_name = get_valid_bean_name($this->module); |
||
56 | $dictionary = array($bean_name => array("fields" => array($field => array()))); |
||
57 | include("$this->base_path/sugarfield_$field.php"); |
||
58 | if (!empty($dictionary[$bean_name]) && isset($dictionary[$bean_name]["fields"][$field])) |
||
59 | $this->custom_def = $dictionary[$bean_name]["fields"][$field]; |
||
60 | } |
||
61 | } |
||
62 | |||
63 | protected function loadBaseDef($field){ |
||
64 | global $beanList; |
||
65 | if (!empty($beanList[$this->module]) && is_file("modules/{$this->module}/vardefs.php")) |
||
66 | { |
||
67 | $dictionary = array(); |
||
68 | include("modules/{$this->module}/vardefs.php"); |
||
69 | if (!empty($dictionary[$beanList[$this->module]]) && isset($dictionary[$beanList[$this->module]]["fields"][$field])) |
||
70 | $this->base_def = $dictionary[$beanList[$this->module]]["fields"][$field]; |
||
71 | } |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * Adds a custom field using a field object |
||
76 | * |
||
77 | * @param Field Object $field |
||
78 | * @return boolean |
||
79 | */ |
||
80 | function addFieldObject(&$field){ |
||
81 | global $dictionary, $beanList; |
||
82 | |||
83 | |||
84 | if (empty($beanList[$this->module])) |
||
85 | return false; |
||
86 | |||
87 | $bean_name = get_valid_bean_name($this->module); |
||
88 | |||
89 | if (empty($dictionary[$bean_name]) || empty($dictionary[$bean_name]["fields"][$field->name])) |
||
90 | return false; |
||
91 | |||
92 | $currdef = $dictionary[$bean_name]["fields"][$field->name]; |
||
93 | |||
94 | // set $field->unified_search=true if field supports unified search |
||
95 | // regarding #51427 |
||
96 | if($field->supports_unified_search) |
||
97 | { |
||
98 | if(isset($dictionary[$bean_name]['unified_search_default_enabled']) && isset($dictionary[$bean_name]['unified_search']) |
||
99 | && $dictionary[$bean_name]['unified_search_default_enabled'] && $dictionary[$bean_name]['unified_search']) |
||
100 | { |
||
101 | $currdef['unified_search'] = $field->unified_search = isset($currdef['unified_search']) |
||
102 | ? $currdef['unified_search'] |
||
103 | : true; |
||
104 | } |
||
105 | } |
||
106 | // end #51427 |
||
107 | |||
108 | $this->loadCustomDef($field->name); |
||
109 | $this->loadBaseDef($field->name); |
||
110 | $newDef = $field->get_field_def(); |
||
111 | |||
112 | require_once ('modules/DynamicFields/FieldCases.php') ; |
||
113 | $this->baseField = get_widget ( $field->type) ; |
||
114 | foreach ($field->vardef_map as $property => $fmd_col){ |
||
115 | |||
116 | if ($property == "action" || $property == "label_value" || $property == "label" |
||
117 | || ((substr($property, 0,3) == 'ext' && strlen($property) == 4)) |
||
118 | ) |
||
119 | continue; |
||
120 | |||
121 | // Bug 37043 - Avoid writing out vardef defintions that are the default value. |
||
122 | if (isset($newDef[$property]) && |
||
123 | ((!isset($currdef[$property]) && !$this->isDefaultValue($property,$newDef[$property], $this->baseField)) |
||
124 | || (isset($currdef[$property]) && $currdef[$property] != $newDef[$property]) |
||
125 | ) |
||
126 | ){ |
||
127 | $this->custom_def[$property] = |
||
128 | is_string($newDef[$property]) ? htmlspecialchars_decode($newDef[$property], ENT_QUOTES) : $newDef[$property]; |
||
0 ignored issues
–
show
|
|||
129 | } |
||
130 | |||
131 | //Remove any orphaned entries |
||
132 | if (isset($this->custom_def[$property]) && !isset($newDef[$property])) |
||
133 | unset($this->custom_def[$property]); |
||
134 | |||
135 | //Handle overrides of out of the box definitions with empty |
||
136 | if (!empty($this->base_def[$property]) && !isset($newDef[$property])) |
||
137 | { |
||
138 | //Switch on type of the property to find what the correct 'empty' is. |
||
139 | if(is_string($this->base_def[$property])) |
||
140 | $this->custom_def[$property] = ""; |
||
141 | else if(is_array($this->base_def[$property])) |
||
142 | $this->custom_def[$property] = array(); |
||
143 | else if(is_bool($this->base_def[$property])) |
||
144 | $this->custom_def[$property] = false; |
||
145 | else |
||
146 | $this->custom_def[$property] = null; |
||
147 | } |
||
148 | } |
||
149 | |||
150 | if (isset($this->custom_def["duplicate_merge_dom_value"]) && !isset($this->custom_def["duplicate_merge"])) |
||
151 | unset($this->custom_def["duplicate_merge_dom_value"]); |
||
152 | |||
153 | $this->writeVardefExtension($bean_name, $field, $this->custom_def); |
||
154 | } |
||
155 | |||
156 | |||
157 | } |
||
158 | |||
159 | ?> |
||
160 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.