Skip to content

Commit ba7c2c5

Browse files
authored
Unset session error message just before exit (hestiacp#3524)
1 parent 736f6d8 commit ba7c2c5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

web/inc/main.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,3 +557,13 @@ function backendtpl_with_webdomains() {
557557
function validate_password($password) {
558558
return preg_match('/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(.){8,}$/', $password);
559559
}
560+
561+
function unset_alerts() {
562+
if (!empty($_SESSION["error_msg"])) {
563+
unset($_SESSION["error_msg"]);
564+
}
565+
if (!empty($_SESSION["ok_msg"])) {
566+
unset($_SESSION["ok_msg"]);
567+
}
568+
}
569+
register_shutdown_function("unset_alerts");

web/templates/includes/js.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
})
1717
</script>
1818

19-
<?php if (!empty($_SESSION['error_msg'])) unset($_SESSION['error_msg']); ?>
2019

2120
<?php
2221
$customScriptDirectory = new DirectoryIterator($_SERVER["HESTIA"] . "/web/js/custom_scripts");

0 commit comments

Comments
 (0)