Skip to content

Commit ab954a4

Browse files
committed
7.10.28
1 parent 51e3161 commit ab954a4

File tree

21 files changed

+787
-2071
lines changed

21 files changed

+787
-2071
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<img width="180px" height="41px" src="https://suitecrm.com/wp-content/uploads/2017/12/logo.png" align="right" />
33
</a>
44

5-
# SuiteCRM 7.10.27
5+
# SuiteCRM 7.10.28
66

77
[![Build Status](https://travis-ci.org/salesagility/SuiteCRM.svg?branch=7.10.x)](https://travis-ci.org/salesagility/SuiteCRM)
88
[![codecov](https://codecov.io/gh/salesagility/SuiteCRM/branch/7.10.x/graph/badge.svg)](https://codecov.io/gh/salesagility/SuiteCRM/branch/7.10.x)

composer.lock

+540-187
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

download.php

+18-5
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,17 @@
184184

185185
// Fix for issue 1506 and issue 1304 : IE11 and Microsoft Edge cannot display generic 'application/octet-stream' (which is defined as "arbitrary binary data" in RFC 2046).
186186
$mime_type = mime_content_type($local_location);
187-
if ($mime_type == null || $mime_type == '') {
188-
$mime_type = 'application/octet-stream';
189-
}
190187

188+
switch ($mime_type) {
189+
case 'text/html':
190+
$mime_type = 'text/plain';
191+
break;
192+
case null:
193+
case '':
194+
$mime_type = 'application/octet-stream';
195+
break;
196+
}
197+
191198
if ($doQuery && isset($query)) {
192199
$rs = DBManagerFactory::getInstance()->query($query);
193200
$row = DBManagerFactory::getInstance()->fetchByAssoc($rs);
@@ -242,7 +249,7 @@
242249
}
243250
} else {
244251
header('Content-type: ' . $mime_type);
245-
if (isset($_REQUEST['preview']) && $_REQUEST['preview'] === 'yes') {
252+
if (isset($_REQUEST['preview']) && $_REQUEST['preview'] === 'yes' && $mime_type !== 'text/html') {
246253
header('Content-Disposition: inline; filename="' . $name . '";');
247254
} else {
248255
header('Content-Disposition: attachment; filename="' . $name . '";');
@@ -260,4 +267,10 @@
260267
;
261268
}
262269

263-
readfile($download_location);
270+
ob_start();
271+
echo clean_file_output(file_get_contents($download_location), $mime_type);
272+
273+
$output = ob_get_contents();
274+
ob_end_clean();
275+
276+
echo $output;

files.md5

+107-1,851
Large diffs are not rendered by default.

include/SugarFields/Fields/File/DetailView.tpl

+14-4
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,20 @@
4242
<span class="sugar_field" id="{{if empty($displayParams.idName)}}{{sugarvar key='name'}}{{else}}{{$displayParams.idName}}{{/if}}">
4343
<a href="index.php?entryPoint=download&id={$fields.{{$vardef.fileId}}.value}&type={{$vardef.linkModule}}" class="tabDetailViewDFLink" target='_blank'>{{sugarvar key='value'}}</a>
4444
&nbsp;
45-
<a href="index.php?preview=yes&entryPoint=download&id={$fields.{{$vardef.fileId}}.value}&type={{$vardef.linkModule}}" class="tabDetailViewDFLink" target='_blank' style="border-bottom: 0px;">
46-
<i class="glyphicon glyphicon-eye-open"></i>
47-
</a>
45+
46+
{if $fields.show_preview.value !== false}
47+
<a href="index.php?preview=yes&
48+
entryPoint=download&
49+
id={$fields.{{$vardef.fileId}}.value}&
50+
type={{$vardef.linkModule}}"
51+
class="tabDetailViewDFLink"
52+
target='_blank'
53+
style="border-bottom: 0px;">
54+
<i class="glyphicon glyphicon-eye-open"></i>
55+
</a>
56+
{/if}
4857
</span>
58+
4959
{{if isset($vardef) && isset($vardef.allowEapm) && $vardef.allowEapm}}
5060
{if isset($fields.{{$vardef.docType}}) && !empty($fields.{{$vardef.docType}}.value) && $fields.{{$vardef.docType}}.value != 'SugarCRM' && !empty($fields.{{$vardef.docUrl}}.value) }
5161
{capture name=imageNameCapture assign=imageName}
@@ -55,5 +65,5 @@
5565
{/if}
5666
{{/if}}
5767
{{if !empty($displayParams.enableConnectors)}}
58-
{{sugarvar_connector view='DetailView'}}
68+
{{sugarvar_connector view='DetailView'}}
5969
{{/if}}

include/SugarFields/Fields/File/ListView.tpl

+9-5
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,21 @@
3939
*/
4040
4141
*}
42+
4243
<a href="index.php?entryPoint=download&id={$parentFieldArray.ID}&type={if empty($vardef.displayParams.module)}{$displayParams.module}{else}{$vardef.displayParams.module}{/if}" class="tabDetailViewDFLink" target='_blank'>{sugar_fetch object=$parentFieldArray key=$col}
4344
{if isset($vardef.allowEapm) && $vardef.allowEapm && isset($parentFieldArray.DOC_TYPE) }
4445
{capture name=imageNameCapture assign=imageName}
45-
{sugar_fetch object=$parentFieldArray key=DOC_TYPE}_image_inline.png
46+
{sugar_fetch object=$parentFieldArray key=DOC_TYPE}_image_inline.png
4647
{/capture}
4748
{capture name=imageURLCapture assign=imageURL}
48-
{sugar_getimagepath file=$imageName}
49+
{sugar_getimagepath file=$imageName}
4950
{/capture}
5051
{if strlen($imageURL)>1}{sugar_getimage name=$imageName alt=$imageName other_attributes='border="0" '}{/if}
5152
{/if}
5253
</a>&nbsp;
53-
<a href="index.php?preview=yes&entryPoint=download&id={$parentFieldArray.ID}&type={if empty($vardef.displayParams.module)}{$displayParams.module}{else}{$vardef.displayParams.module}{/if}" class="tabDetailViewDFLink" target='_blank' style="border-bottom: 0px;">
54-
<i class="glyphicon glyphicon-eye-open"></i>
55-
</a>
54+
55+
{if isset($parentFieldArray.SHOW_PREVIEW) && $parentFieldArray.SHOW_PREVIEW !== false }
56+
<a href="index.php?preview=yes&entryPoint=download&id={$parentFieldArray.ID}&type={if empty($vardef.displayParams.module)}{$displayParams.module}{else}{$vardef.displayParams.module}{/if}" class="tabDetailViewDFLink" target='_blank' style="border-bottom: 0px;">
57+
<i class="glyphicon glyphicon-eye-open"></i>
58+
</a>
59+
{/if}

include/SugarObjects/templates/file/File.php

+5
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ class File extends Basic
5656
public $uploadfile;
5757
public $status;
5858
public $file_mime_type;
59+
public $show_preview = true;
5960

6061

6162
/**
@@ -117,6 +118,10 @@ public function fill_in_additional_detail_fields()
117118
$img_name_bare = strtolower($this->file_ext) . '_image_inline';
118119
}
119120

121+
if (empty($this->filename) || stripos($this->filename, 'svg') || stripos($this->file_mime_type , 'svg')){
122+
$this->show_preview = false;
123+
}
124+
120125
//set default file name.
121126
if (!empty($img_name) && file_exists($img_name)) {
122127
$img_name = $img_name_bare;

include/SugarObjects/templates/file/vardefs.php

+6
Original file line numberDiff line numberDiff line change
@@ -140,5 +140,11 @@
140140
'source' => 'non-db',
141141
'Comment' => 'Document status for Meta-Data framework',
142142
),
143+
'show_preview' => array(
144+
'name' => 'show_preview',
145+
'type' => 'bool',
146+
'source' => 'non-db',
147+
'reportable' => false
148+
),
143149
)
144150
);

include/utils.php

+17
Original file line numberDiff line numberDiff line change
@@ -2300,6 +2300,20 @@ function clean_string($str, $filter = 'STANDARD', $dieOnBadData = true)
23002300
return $str;
23012301
}
23022302

2303+
function clean_file_output($string, $mine_type)
2304+
{
2305+
$patterns = [];
2306+
2307+
if ($mine_type === 'image/svg+xml') {
2308+
$patterns[] = "/onload=\"window.location='(.*?)'\"/";
2309+
}
2310+
2311+
$string = preg_replace($patterns, '', $string);
2312+
2313+
return $string;
2314+
}
2315+
2316+
23032317
function clean_special_arguments()
23042318
{
23052319
if (isset($_SERVER['PHP_SELF'])) {
@@ -2496,7 +2510,10 @@ function securexss($value)
24962510

24972511
return $new;
24982512
}
2513+
24992514
static $xss_cleanup = ['&quot;' => '&#38;', '"' => '&quot;', "'" => '&#039;', '<' => '&lt;', '>' => '&gt;', '`' => '&#96;'];
2515+
2516+
$value = preg_replace('/^[=@+-]/', '', $value);
25002517
$value = preg_replace(array('/javascript:/i', '/\0/'), array('java script:', ''), $value);
25012518
$value = preg_replace('/javascript:/i', 'java script:', $value);
25022519

install.php

+39-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
66
*
77
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
8-
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
8+
* Copyright (C) 2011 - 2020 SalesAgility Ltd.
99
*
1010
* This program is free software; you can redistribute it and/or modify it under
1111
* the terms of the GNU Affero General Public License version 3 as published by the
@@ -37,9 +37,10 @@
3737
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
3838
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
3939
*/
40-
if (!defined('sugarEntry')) {
41-
define('sugarEntry', true);
42-
}
40+
41+
if (!defined('sugarEntry')) {
42+
define('sugarEntry', true);
43+
}
4344

4445
require_once 'include/utils.php';
4546
@session_start();
@@ -180,6 +181,39 @@ function getSupportedInstallLanguages()
180181
//get the url for the helper link
181182
$help_url = get_help_button_url();
182183

184+
if (isset($sugar_config['installer_locked']) && $sugar_config['installer_locked'] == true) {
185+
if (!empty($_POST['current_step']) && $_POST['current_step'] === '3' && !empty($_POST['goto']) && $_POST['goto'] === $mod_strings['LBL_NEXT']) {
186+
session_unset();
187+
$the_file = 'complete_install.php';
188+
} else {
189+
$the_file = 'installDisabled.php';
190+
$disabled_title = $mod_strings['LBL_DISABLED_DESCRIPTION'];
191+
$disabled_title_2 = $mod_strings['LBL_DISABLED_TITLE_2'];
192+
$disabled_text = <<<EOQ
193+
<p>{$mod_strings['LBL_DISABLED_DESCRIPTION']}</p>
194+
<pre>
195+
'installer_locked' => false,
196+
</pre>
197+
<p>{$mod_strings['LBL_DISABLED_DESCRIPTION_2']}</p>
198+
199+
<p>{$mod_strings['LBL_DISABLED_HELP_1']} <a href="{$mod_strings['LBL_DISABLED_HELP_LNK']}" target="_blank">{$mod_strings['LBL_DISABLED_HELP_2']}</a>.</p>
200+
EOQ;
201+
202+
}
203+
$the_file = 'install/' . clean_string($the_file, 'FILE');
204+
205+
if (is_file($the_file)) {
206+
installerHook('pre_installFileRequire', ['the_file' => $the_file]);
207+
require($the_file);
208+
die();
209+
}
210+
LoggerManager::getLogger()->fatal('Install file not found: ' . $the_file);
211+
die('SuiteCRM Installation has been Disabled');
212+
}
213+
214+
215+
216+
183217
//if this license print, then redirect and exit,
184218
if (isset($_REQUEST['page']) && $_REQUEST['page'] == 'licensePrint') {
185219
include('install/licensePrint.php');
@@ -720,7 +754,7 @@ function getSupportedInstallLanguages()
720754
$sugar_config['unique_key'] = md5(create_guid());
721755
}
722756

723-
$validation_errors = validate_dbConfig('a');
757+
$validation_errors = validate_dbConfig();
724758
if (count($validation_errors) > 0) {
725759
$the_file = 'dbConfig_a.php';
726760
$si_errors = true;

install/installDisabled.php

-7
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,6 @@
8282
<tr>
8383
<td align="right" colspan="2" height="20">
8484
<hr>
85-
<form action="install.php" method="post" name="form" id="form">
86-
<table cellspacing="0" cellpadding="0" border="0" class="stdTable">
87-
<tr>
88-
<td><input class="button" type="submit" value="{$mod_strings['LBL_START']}" /></td>
89-
</tr>
90-
</table>
91-
</form>
9285
</td>
9386
</tr>
9487
</table>

modules/Configurator/Configurator.php

+5
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ public function populateFromPost()
7676
$sugarConfig = SugarConfig::getInstance();
7777
foreach ($_POST as $key => $value) {
7878
if ($key == "logger_file_ext") {
79+
if ($value === '') {
80+
$GLOBALS['log']->security("Log file extension can't be blank.");
81+
continue;
82+
}
83+
7984
$trim_value = preg_replace('/.*\.([^\.]+)$/', '\1', $value);
8085
if (in_array($trim_value, $this->config['upload_badext'])) {
8186
$GLOBALS['log']->security("Invalid log file extension: trying to use invalid file extension '$value'.");

modules/Documents/Document.php

+6
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class Document extends File
100100
);
101101

102102
public $authenticated = null;
103+
public $show_preview = true;
103104

104105
public function __construct()
105106
{
@@ -276,9 +277,14 @@ public function fill_in_additional_detail_fields()
276277
//if file is not found then default image file will be used.
277278
global $img_name;
278279
global $img_name_bare;
280+
279281
if (!empty($row['file_ext'])) {
280282
$img_name = SugarThemeRegistry::current()->getImageURL(strtolower($row['file_ext']) . "_image_inline.gif");
281283
$img_name_bare = strtolower($row['file_ext']) . "_image_inline";
284+
285+
if ($row['file_ext'] == 'svg') {
286+
$this->show_preview = false;
287+
}
282288
}
283289
}
284290

modules/Documents/vardefs.php

+6
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,12 @@
428428
'source' => 'non-db',
429429
'module' => 'AOS_Contracts',
430430
),
431+
'show_preview' => array(
432+
'name' => 'show_preview',
433+
'type' => 'bool',
434+
'source' => 'non-db',
435+
'reportable' => false
436+
),
431437

432438
),
433439
'indices' => array(

modules/Notes/vardefs.php

+7
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,13 @@
276276
'source'=>'non-db',
277277
'options'=> 'record_type_display_notes',
278278
],
279+
'show_preview' =>
280+
[
281+
'name' => 'show_preview',
282+
'type' => 'bool',
283+
'source' => 'non-db',
284+
'reportable' => false
285+
],
279286

280287
'contact_name'=>
281288
[

suitecrm_version.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
die('Not A Valid Entry Point');
44
}
55

6-
$suitecrm_version = '7.10.27';
7-
$suitecrm_timestamp = '2020-06-11 12:00:00';
6+
$suitecrm_version = '7.10.28';
7+
$suitecrm_timestamp = '2020-10-28 12:00:00';

tests/unit/phpunit/modules/Notes/NoteTest.php

+1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ public function testget_list_view_data()
135135
'PARENT_TYPE' => 'Account',
136136
'EMBED_FLAG' => '0',
137137
'DELETED' => 0,
138+
'SHOW_PREVIEW' => true,
138139
'CONTACT_NAME' => 'test contact',
139140
'PARENT_MODULE' => 'Account',
140141
'STATUS' => 'Note',

themes/SuiteP/css/Dawn/style.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/SuiteP/css/Day/style.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/SuiteP/css/Dusk/style.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

themes/SuiteP/css/Night/style.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)