Merge pull request #14591 from TobiasSekan/AvoidUseCurlyBracesOnContactList

FIX Avoid use of curly braces on contact list (PHP 7.4+)
This commit is contained in:
Laurent Destailleur 2020-08-31 16:13:33 +02:00 committed by GitHub
commit 0f68854baa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,7 +77,7 @@ $search_no_email = GETPOST("search_no_email", 'int');
if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
$search_{$key} = GETPOST("search_".$key, 'alpha');
$search_[$key] = GETPOST("search_".$key, 'alpha');
}
}
}
@ -265,7 +265,7 @@ if (empty($reshook))
if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
if ($value['active']) {
$search_{$key} = "";
$search_[$key] = "";
}
}
}
@ -407,8 +407,8 @@ if (strlen($search_phone_mobile)) $sql .= natural_search('p.phone_mobile', $se
if (strlen($search_fax)) $sql .= natural_search('p.fax', $search_fax);
if (!empty($conf->socialnetworks->enabled)) {
foreach ($socialnetworks as $key => $value) {
if ($value['active'] && strlen($search_{$key})) {
$sql .= ' AND p.socialnetworks LIKE \'%"'.$key.'":"'.$search_{$key}.'%\'';
if ($value['active'] && strlen($search_[$key])) {
$sql .= ' AND p.socialnetworks LIKE \'%"'.$key.'":"'.$search_[$key].'%\'';
}
}
}
@ -719,7 +719,7 @@ if (!empty($conf->socialnetworks->enabled)) {
if (!empty($arrayfields['p.'.$key]['checked']))
{
print '<td class="liste_titre">';
print '<input class="flat" type="text" name="search_'.$key.'" size="6" value="'.dol_escape_htmltag($search_{$key}).'">';
print '<input class="flat" type="text" name="search_'.$key.'" size="6" value="'.dol_escape_htmltag($search_[$key]).'">';
print '</td>';
}
}