mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
prevent variable name collision in renderTemplate() function
This commit is contained in:
parent
1d6b4e6468
commit
29d4653524
@ -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();
|
||||
|
@ -43,11 +43,11 @@
|
||||
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content">
|
||||
<?php echo renderTemplate("dhcp/general", $data) ?>
|
||||
<?php echo renderTemplate("dhcp/advanced", $data) ?>
|
||||
<?php echo renderTemplate("dhcp/clients", $data) ?>
|
||||
<?php echo renderTemplate("dhcp/static_leases", $data) ?>
|
||||
<?php echo renderTemplate("dhcp/logging", $data) ?>
|
||||
<?php echo renderTemplate("dhcp/general", $__template_data) ?>
|
||||
<?php echo renderTemplate("dhcp/advanced", $__template_data) ?>
|
||||
<?php echo renderTemplate("dhcp/clients", $__template_data) ?>
|
||||
<?php echo renderTemplate("dhcp/static_leases", $__template_data) ?>
|
||||
<?php echo renderTemplate("dhcp/logging", $__template_data) ?>
|
||||
</div><!-- /.tab-content -->
|
||||
|
||||
<?php echo $buttons ?>
|
||||
|
Loading…
Reference in New Issue
Block a user