From 29d4653524852b81769d846c863fce9cf63c0b50 Mon Sep 17 00:00:00 2001 From: glaszig Date: Fri, 6 Mar 2020 16:54:48 +0100 Subject: [PATCH] prevent variable name collision in renderTemplate() function --- includes/functions.php | 6 +++--- templates/dhcp.php | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index c5ba1a47..e177aa52 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -271,15 +271,15 @@ function ConvertToSecurity($security) /** * Renders a simple PHP template */ -function renderTemplate($name, $data = []) +function renderTemplate($name, $__template_data = []) { $file = realpath(dirname(__FILE__) . "/../templates/$name.php"); if (!file_exists($file)) { return "template $name ($file) not found"; } - if (is_array($data)) { - extract($data); + if (is_array($__template_data)) { + extract($__template_data); } ob_start(); diff --git a/templates/dhcp.php b/templates/dhcp.php index 2b57586a..c93ab7ef 100755 --- a/templates/dhcp.php +++ b/templates/dhcp.php @@ -43,11 +43,11 @@
- - - - - + + + + +