Skip to content

Commit

Permalink
fix(App) PHP 8 adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
joebordes committed Aug 8, 2021
1 parent d2b06fb commit f8a0221
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/fields/DateTimeField.php
Expand Up @@ -204,7 +204,7 @@ public static function formatDatebaseTimeString($datetime, $fmt) {
*/
public static function twoDigit($no) {
$no = trim($no);
if ($no < 10 && strlen($no) < 2) {
if ((int)$no < 10 && strlen($no) < 2) {
$no = '0'.$no;
}
return substr($no, 0, 2);
Expand Down
5 changes: 2 additions & 3 deletions include/utils/CommonUtils.php
Expand Up @@ -599,9 +599,8 @@ function getContactName($contact_id) {
global $log, $adb, $current_user;
$log->debug('> getContactName '.$contact_id);
$contact_name = '';
if ($contact_id != '') {
$sql = 'select firstname, lastname from vtiger_contactdetails where contactid=?';
$result = $adb->pquery($sql, array($contact_id));
if (!empty($contact_id)) {
$result = $adb->pquery('select firstname, lastname from vtiger_contactdetails where contactid=?', array($contact_id));
$firstname = $adb->query_result($result, 0, 'firstname');
$lastname = $adb->query_result($result, 0, 'lastname');
$contact_name = $lastname;
Expand Down
4 changes: 3 additions & 1 deletion include/utils/VtlibUtils.php
Expand Up @@ -93,7 +93,9 @@ function vtlib_prefetchModuleActiveInfo($force = true) {
*/
function vtlib_isModuleActive($module) {
global $__cache_module_activeinfo, $adb;

if (is_numeric($module) || empty($module)) {
return false;
}
if (in_array($module, vtlib_moduleAlwaysActive())) {
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions modules/GlobalVariable/SearchGlobalVarws.php
Expand Up @@ -25,7 +25,7 @@
* the default value given: if a variable record is not found or the current user does not have access to the Global Variable module
*/
function cbws_SearchGlobalVar($gvname, $defaultvalue, $gvmodule, $user) {
global $log, $adb;
global $log, $adb, $default_charset;

$entityName = 'GlobalVariable';
$webserviceObject = VtigerWebserviceObject::fromName($adb, $entityName);
Expand All @@ -48,7 +48,7 @@ function cbws_SearchGlobalVar($gvname, $defaultvalue, $gvmodule, $user) {
$rs = $adb->pquery('select contentjson from vtiger_cbmap where cbmapid=?', array($rdo));
$rdo = array(
'id' => vtws_getEntityID('cbMap').'x'.$rdo,
'map' => $adb->query_result($rs, 0, 0),
'map' => html_entity_decode($adb->query_result($rs, 0, 0), ENT_QUOTES, $default_charset),
);
}
} else {
Expand Down

0 comments on commit f8a0221

Please sign in to comment.