From f2e9a1968d24ebaa52fb2417f611e5f9dc4fd053 Mon Sep 17 00:00:00 2001 From: Dasc3er Date: Wed, 23 Sep 2020 12:00:21 +0200 Subject: [PATCH] Correzioni per il caricamento generale --- ajax_dataload.php | 10 ++++++---- core.php | 17 ++++++++--------- modules/anagrafiche/bulk.php | 2 ++ plugins/importFE/src/Interaction.php | 4 +++- plugins/importFE/src/InvoiceHook.php | 2 +- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/ajax_dataload.php b/ajax_dataload.php index 3d8a45e04..58e2e0cde 100755 --- a/ajax_dataload.php +++ b/ajax_dataload.php @@ -22,11 +22,13 @@ include_once __DIR__.'/core.php'; use Util\Query; // Informazioni fondamentali -$columns = filter('columns'); -$order = filter('order')[0]; +$columns = (array) filter('columns'); +$order = filter('order') ? filter('order')[0] : []; $draw_numer = intval(filter('draw')); -$order['column'] = $order['column'] - 1; +if (!empty(filter('order'))) { + $order['column'] = $order['column'] - 1; +} array_shift($columns); $total = Util\Query::readQuery($structure); @@ -157,7 +159,7 @@ if (!empty($query)) { $id_record = $r['id']; $hash = ''; - $id_module = $r['_link_module_'] ?: $id_module; + $id_module = !empty($r['_link_module_']) ? $r['_link_module_'] : $id_module; if (!empty($r['_link_record_'])) { $id_record = $r['_link_record_']; $hash = !empty($r['_link_hash_']) ? '#'.$r['_link_hash_'] : ''; diff --git a/core.php b/core.php index 66cc7c47f..3b5eed64e 100755 --- a/core.php +++ b/core.php @@ -20,8 +20,6 @@ // Rimozione header X-Powered-By header_remove('X-Powered-By'); -ini_set('session.cookie_samesite', 'strict'); - // Impostazioni di configurazione PHP date_default_timezone_set('Europe/Rome'); @@ -121,6 +119,14 @@ if (!API\Response::isAPIRequest()) { $handlers[] = new StreamHandler($docroot.'/logs/api.log', Monolog\Logger::ERROR); } +// Sicurezza della sessioni +ini_set('session.cookie_samesite', 'strict'); +ini_set('session.use_trans_sid', '0'); +ini_set('session.use_only_cookies', '1'); + +session_set_cookie_params(0, $rootdir, null, isHTTPS(true)); +session_start(); + // Disabilita i messaggi nativi di PHP ini_set('display_errors', 0); // Ignora gli avvertimenti e le informazioni relative alla deprecazione di componenti @@ -144,13 +150,6 @@ $dbo = $database = database(); /* SESSIONE */ if (!API\Response::isAPIRequest()) { - // Sicurezza della sessioni - ini_set('session.use_trans_sid', '0'); - ini_set('session.use_only_cookies', '1'); - - session_set_cookie_params(0, $rootdir, null, isHTTPS(true)); - session_start(); - // Barra di debug (necessario per loggare tutte le query) if (App::debug()) { $debugbar = new DebugBar\DebugBar(); diff --git a/modules/anagrafiche/bulk.php b/modules/anagrafiche/bulk.php index 45a6b90ad..35aa2f1b2 100755 --- a/modules/anagrafiche/bulk.php +++ b/modules/anagrafiche/bulk.php @@ -65,6 +65,8 @@ switch (post('op')) { break; } +$operations = []; + if (App::debug()) { $operations['delete-bulk'] = [ 'text' => ' '.tr('Elimina selezionati').'', diff --git a/plugins/importFE/src/Interaction.php b/plugins/importFE/src/Interaction.php index 10af3bb35..a4ef30a0d 100755 --- a/plugins/importFE/src/Interaction.php +++ b/plugins/importFE/src/Interaction.php @@ -44,6 +44,8 @@ class Interaction extends Services public static function getRemoteList() { + $list = []; + // Ricerca da remoto if (self::isEnabled()) { $response = static::request('POST', 'fatture_da_importare'); @@ -54,7 +56,7 @@ class Interaction extends Services } } - return $list ?: []; + return $list; } public static function getFileList($list = []) diff --git a/plugins/importFE/src/InvoiceHook.php b/plugins/importFE/src/InvoiceHook.php index 90c7155ad..4da147a40 100755 --- a/plugins/importFE/src/InvoiceHook.php +++ b/plugins/importFE/src/InvoiceHook.php @@ -36,7 +36,7 @@ class InvoiceHook extends CachedManager public function response() { - $results = $this->getCache()->content; + $results = (array) $this->getCache()->content; $count = count($results); $notify = false;