Skip to content

Commit 079b95d

Browse files
committed
Rename redirect to redirect_url for Laravel compatibility
1 parent ba0e734 commit 079b95d

46 files changed

Lines changed: 119 additions & 119 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

actions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@
178178
// Determina il redirect appropriato in base al tipo di accesso
179179
if (Permissions::isTokenAccess() && !empty($_SESSION['token_access']['id_module_target']) && !empty($_SESSION['token_access']['id_record_target'])) {
180180
// Per accesso tramite token, redirect a shared_editor.php
181-
redirect(base_path().'/shared_editor.php?id_module='.$id_module.'&id_record='.$id_record.((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : ''));
181+
redirect_url(base_path().'/shared_editor.php?id_module='.$id_module.'&id_record='.$id_record.((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : ''));
182182
} else {
183183
// Per accesso normale, redirect a editor.php
184-
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : ''));
184+
redirect_url(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.((!empty($options['id_plugin'])) ? '#tab_'.$options['id_plugin'] : ''));
185185
}
186186
}
187187
}
@@ -523,7 +523,7 @@
523523
$bulk = empty($bulk) ? [] : $bulk;
524524

525525
if (in_array(post('op'), array_keys($bulk))) {
526-
redirect(base_path().'/controller.php?id_module='.$id_module, 'js');
526+
redirect_url(base_path().'/controller.php?id_module='.$id_module, 'js');
527527
} else {
528528
// Esecuzione delle operazioni del modulo
529529
($include_file = $structure->filepath('actions.php')) ? include $include_file : null;

assets/src/js/functions/functions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,15 +300,15 @@ function message(element) {
300300
},
301301
});
302302
} else {
303-
redirect(href, data, method, blank);
303+
redirect_url(href, data, method, blank);
304304
}
305305
},
306306
function (dismiss) {
307307
}
308308
);
309309
}
310310

311-
function redirect(href, data, method, blank) {
311+
function redirect_url(href, data, method, blank) {
312312
method = method ? method : "get";
313313
blank = blank ? blank : false;
314314

controller.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
include_once __DIR__.'/core.php';
2424

2525
if (!empty($id_record) && !empty($id_module)) {
26-
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record);
26+
redirect_url(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record);
2727
} elseif (empty($id_module)) {
28-
redirect(base_path().'/index.php');
28+
redirect_url(base_path().'/index.php');
2929
}
3030

3131
include_once App::filepath('include|custom|', 'top.php');

core.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
}
193193
}
194194

195-
redirect(base_path().'/index.php');
195+
redirect_url(base_path().'/index.php');
196196
exit;
197197
}
198198

editor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
$module_header_html = '';
2828

2929
if (empty($id_record) && !empty($id_module) && empty($id_plugin)) {
30-
redirect(base_path().'/controller.php?id_module='.$id_module);
30+
redirect_url(base_path().'/controller.php?id_module='.$id_module);
3131
} elseif (empty($id_record) && empty($id_module) && empty($id_plugin)) {
32-
redirect(base_path().'/index.php');
32+
redirect_url(base_path().'/index.php');
3333
}
3434

3535
include_once App::filepath('include|custom|', 'top.php');

include/init/configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@
183183
else {
184184
// Creazione manifest.json
185185
include_once App::filepath('include/init', 'manifest.php');
186-
redirect(base_path().'/index.php');
186+
redirect_url(base_path().'/index.php');
187187
exit;
188188
}
189189
}
@@ -425,7 +425,7 @@ class: "img-flag",
425425
var parameters = getUrlVars();
426426
parameters.lang = $(this).val();
427427
428-
redirect(url, parameters);
428+
redirect_url(url, parameters);
429429
}
430430
});
431431
}

include/init/init.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
}
123123
}
124124

125-
redirect(base_path(), 'js');
125+
redirect_url(base_path(), 'js');
126126
exit;
127127
}
128128

index.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
flash()->error(Auth::getStatus()[$status]['message']);
6666

67-
redirect(base_path().'/index.php');
67+
redirect_url(base_path().'/index.php');
6868
exit;
6969
}
7070

@@ -75,15 +75,15 @@
7575
// Pulisce anche l'intended URL al logout
7676
Auth::clearIntended();
7777

78-
redirect(base_path().'/index.php');
78+
redirect_url(base_path().'/index.php');
7979
exit;
8080
}
8181

8282
if (Auth::check() && isset($dbo) && $dbo->isConnected() && $dbo->isInstalled()) {
8383
// Priorità 1: Token access (sistema esistente)
8484
if (Permissions::isTokenAccess()) {
8585
if (!empty($_SESSION['token_access']['id_module_target']) && !empty($_SESSION['token_access']['id_record_target'])) {
86-
redirect(base_path().'/shared_editor.php?id_module='.$_SESSION['token_access']['id_module_target'].'&id_record='.$_SESSION['token_access']['id_record_target']);
86+
redirect_url(base_path().'/shared_editor.php?id_module='.$_SESSION['token_access']['id_module_target'].'&id_record='.$_SESSION['token_access']['id_record_target']);
8787
exit;
8888
}
8989
}
@@ -95,7 +95,7 @@
9595
// Verifica i permessi per l'URL intended
9696
if (Auth::canAccessIntended()) {
9797
Auth::clearIntended();
98-
redirect($intended_url);
98+
redirect_url($intended_url);
9999
exit;
100100
} else {
101101
// L'utente non ha i permessi per accedere alla pagina richiesta
@@ -108,16 +108,16 @@
108108
$module = Auth::firstModule();
109109

110110
if (!empty($module)) {
111-
redirect(base_path().'/controller.php?id_module='.$module);
111+
redirect_url(base_path().'/controller.php?id_module='.$module);
112112
} else {
113-
redirect(base_path().'/index.php?op=logout');
113+
redirect_url(base_path().'/index.php?op=logout');
114114
}
115115
exit;
116116
}
117117

118118
// Gestione accesso tramite token OTP
119119
if (!empty($token) && $dbo->isConnected() && $dbo->isInstalled()) {
120-
redirect(base_path().'/token_login.php?token='.urlencode($token));
120+
redirect_url(base_path().'/token_login.php?token='.urlencode($token));
121121
exit;
122122
}
123123

lib/functions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
*
4040
* @return bool
4141
*/
42-
function redirect($url, $type = 'php')
42+
function redirect_url($url, $type = 'php')
4343
{
4444
switch ($type) {
4545
case 'php':
@@ -320,9 +320,9 @@ function redirectOperation($id_module, $id_record)
320320
$hash = $hash == '#tab_0' ? '' : $hash;
321321

322322
if ($backto == 'record-edit') {
323-
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.$hash);
323+
redirect_url(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record.$hash);
324324
} elseif ($backto == 'record-list') {
325-
redirect(base_path().'/controller.php?id_module='.$id_module.$hash);
325+
redirect_url(base_path().'/controller.php?id_module='.$id_module.$hash);
326326
}
327327

328328
exit;

modules/aggiornamenti/upload_modules.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,4 +218,4 @@
218218
delete($extraction_dir);
219219

220220
// Redirect
221-
redirect(base_path().'/editor.php?id_module='.$id_module);
221+
redirect_url(base_path().'/editor.php?id_module='.$id_module);

0 commit comments

Comments
 (0)