diff --git a/actions.php b/actions.php index cca727e2a..d297dbc04 100755 --- a/actions.php +++ b/actions.php @@ -349,10 +349,12 @@ HTMLBuilder\HTMLBuilder::setRecord($record); if ($structure->permission == 'rw') { // Esecuzione delle operazioni di gruppo - $id_records = post('id_records'); - $id_records = is_array($id_records) ? $id_records : explode(';', $id_records); - $id_records = array_clean($id_records); - $id_records = array_unique($id_records); + if (!empty(post('id_records'))){ + $id_records = post('id_records'); + $id_records = is_array($id_records) ? $id_records : explode(';', $id_records); + $id_records = array_clean($id_records); + $id_records = array_unique($id_records); + } $bulk = $structure->filepath('bulk.php'); $bulk = empty($bulk) ? [] : include $bulk; diff --git a/ajax_dataload.php b/ajax_dataload.php index b58fecb4f..de41ca4cc 100755 --- a/ajax_dataload.php +++ b/ajax_dataload.php @@ -80,7 +80,9 @@ if (!empty($query)) { $align = []; $row = isset($rows[0]) ? $rows[0] : []; foreach ($row as $field => $value) { - $value = trim($value); + if (!empty($value)){ + $value = trim($value); + } // Allineamento a destra se il valore della prima riga risulta numerica if (is_numeric($value) && formatter()->isStandardNumber($value)) { @@ -119,7 +121,9 @@ if (!empty($query)) { $column['class'] = $align[$field]; } - $value = trim($r[$field]); + if (!empty($r[$field])){ + $value = trim($r[$field]); + } // Formattazione HTML if (empty($total['html_format'][$pos]) && !empty($value)) { diff --git a/composer.json b/composer.json index 7c28d2fa3..7d56eed16 100755 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ }], "type": "project", "require": { - "php": ">=7.2", + "php": "^7.3|^8.0", "ext-curl": "*", "ext-dom": "*", "ext-fileinfo": "*", @@ -34,9 +34,9 @@ "dragonmantank/cron-expression": "^1.0", "ezyang/htmlpurifier": "^4.8", "filp/whoops": "^2.1", - "guzzlehttp/guzzle": "^6.3", + "guzzlehttp/guzzle": "^7.0.1", "ifsnop/mysqldump-php": "^2.3", - "illuminate/database": "^6.0", + "illuminate/database": "^8.0", "intervention/image": "^2.3", "league/csv": "9.5.0", "league/oauth2-client": "^2.6", @@ -63,7 +63,7 @@ "wdog/sdd_ita": "dev-master" }, "require-dev": { - "codeception/codeception": "^3.0", + "codeception/codeception": "^4.0", "friendsofphp/php-cs-fixer": "^2.10" }, "autoload": { @@ -137,10 +137,11 @@ "sort-packages": true, "optimize-autoloader": false, "apcu-autoloader": true, + "minimum-stability": "dev", "prefer-stable": true, "platform-check": false, "platform": { - "php": "7.4" + "php": "8.0.17" }, "allow-plugins": { "kylekatarnls/update-helper": true diff --git a/src/Database.php b/src/Database.php index a37707b38..2457a6077 100755 --- a/src/Database.php +++ b/src/Database.php @@ -386,7 +386,10 @@ class Database extends Util\Singleton */ public function prepare($parameter) { - return $this->getPDO()->quote($parameter); + if (!empty($parameter)) + return $this->getPDO()->quote($parameter); + else + return true; } /** diff --git a/src/Intl/Formatter.php b/src/Intl/Formatter.php index 1b5b3ee54..05f082c1b 100755 --- a/src/Intl/Formatter.php +++ b/src/Intl/Formatter.php @@ -421,14 +421,18 @@ class Formatter */ public function formatDate($value) { - $object = DateTime::createFromFormat(static::$standards['date'], $value); + if (!empty($value)){ + $object = DateTime::createFromFormat(static::$standards['date'], $value); - // Fallback per la gestione dei timestamp - $object = !is_object($object) ? DateTime::createFromFormat(static::$standards['timestamp'], $value) : $object; + // Fallback per la gestione dei timestamp + $object = !is_object($object) ? DateTime::createFromFormat(static::$standards['timestamp'], $value) : $object; - $result = is_object($object) ? $object->format($this->getDatePattern()) : false; + $result = is_object($object) ? $object->format($this->getDatePattern()) : false; - return $result; + return $result; + }else{ + return true; + } } /** diff --git a/src/Util/Query.php b/src/Util/Query.php index 28360b522..2aed990ca 100755 --- a/src/Util/Query.php +++ b/src/Util/Query.php @@ -376,9 +376,15 @@ class Query $select[] = $view['query'].(!empty($view['name']) ? " AS '".$view['name']."'" : ''); if (!empty($view['visible'])) { - $view['name'] = trim($view['name']); - $view['search_inside'] = trim($view['search_inside']); - $view['order_by'] = trim($view['order_by']); + if (!empty($view['name'])){ + $view['name'] = trim($view['name']); + } + if (!empty($view['search_inside'])){ + $view['search_inside'] = trim($view['search_inside']); + } + if (!empty($view['order_by'])){ + $view['order_by'] = trim($view['order_by']); + } $fields[] = trim($view['name']);