Skip to content

Commit 73859eb

Browse files
committed
fix: query personalizzate
1 parent 51c74b6 commit 73859eb

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

modules/aggiornamenti/edit.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ function base_dir()
9595
</style>';
9696

9797
if (!function_exists('normalizeForDiff')) {
98-
function normalizeForDiff($text) {
99-
$text = preg_replace('/<br\s*\/?>/i', '', $text);
100-
$text = preg_replace('/\s+/', ' ', $text);
101-
$text = str_replace(['"', "'", '`'], "'", $text);
98+
function normalizeForDiff($text)
99+
{
100+
$text = preg_replace('/<br\s*\/?>/i', '', (string) $text);
101+
$text = preg_replace('/\s+/', ' ', (string) $text);
102+
$text = str_replace(['"', "'"], "'", $text);
102103
$text = html_entity_decode($text, ENT_QUOTES | ENT_HTML5, 'UTF-8');
103104
return trim($text);
104105
}

modules/aggiornamenti/modutil.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ function customViewsNotStandard()
344344

345345
$current_query = trim($view['query']);
346346
$current_query = preg_replace('/<br\s*\/?>/i', '', $current_query);
347-
$current_query = preg_replace('/\s+/', ' ', $current_query);
348-
$current_query = str_replace(['"', "'", '`'], "'", $current_query);
347+
$current_query = preg_replace('/\s+/', ' ', (string) $current_query);
348+
$current_query = str_replace(['"', "'"], "'", $current_query);
349349
$current_query = html_entity_decode($current_query, ENT_QUOTES | ENT_HTML5, 'UTF-8');
350350
$current_query = trim($current_query);
351351

@@ -366,8 +366,8 @@ function customViewsNotStandard()
366366
$expected_query = trim($standard_views[$module_name][$view_name]);
367367

368368
$expected_query = preg_replace('/<br\s*\/?>/i', '', $expected_query);
369-
$expected_query = preg_replace('/\s+/', ' ', $expected_query);
370-
$expected_query = str_replace(['"', "'", '`'], "'", $expected_query);
369+
$expected_query = preg_replace('/\s+/', ' ', (string) $expected_query);
370+
$expected_query = str_replace(['"', "'"], "'", $expected_query);
371371
$expected_query = html_entity_decode($expected_query, ENT_QUOTES | ENT_HTML5, 'UTF-8');
372372
$expected_query = trim($expected_query);
373373

@@ -443,8 +443,8 @@ function normalizeModuleOptions($text)
443443
// Normalizza spazi multipli
444444
$text = preg_replace('/\s+/', ' ', $text);
445445

446-
// Normalizza virgolette
447-
$text = str_replace(['"', "'", '`'], "'", $text);
446+
// Normalizza virgolette (mantieni i backtick per le query SQL)
447+
$text = str_replace(['"', "'"], "'", $text);
448448

449449
// Normalizza entità HTML comuni
450450
$text = html_entity_decode($text, ENT_QUOTES | ENT_HTML5, 'UTF-8');

0 commit comments

Comments
 (0)