aboutsummaryrefslogtreecommitdiffhomepage
path: root/misc
diff options
context:
space:
mode:
Diffstat (limited to 'misc')
-rw-r--r--misc/defaults_password_hash.php5
-rw-r--r--misc/render_template.php3
2 files changed, 8 insertions, 0 deletions
diff --git a/misc/defaults_password_hash.php b/misc/defaults_password_hash.php
new file mode 100644
index 0000000..427179b
--- /dev/null
+++ b/misc/defaults_password_hash.php
@@ -0,0 +1,5 @@
+<?php
+
+function defaults_password_hash(#[\SensitiveParameter] string $password) {
+ return password_hash($password, PASSWORD_ARGON2ID);
+} \ No newline at end of file
diff --git a/misc/render_template.php b/misc/render_template.php
index 1ee349d..294fc16 100644
--- a/misc/render_template.php
+++ b/misc/render_template.php
@@ -35,8 +35,11 @@ function render_template(string $templateName, array $args = []) {
}
function call_template(string $templateName, array $args = [], callable $slotContent = null) {
global $__spooky_magical_template_global_state;
+ // note to self: yes this does actually clone the array
+ $__spooky_magical_template_global_state['previousState'] = $__spooky_magical_template_global_state;
$__spooky_magical_template_global_state['slotContent'] = $slotContent;
render_template($templateName, $args);
+ $__spooky_magical_template_global_state = $__spooky_magical_template_global_state['previousState'];
}
}