1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Merge pull request #1294 from RaspAP/fix/getnetcfg

Resolve local server in getNetConfig() + minor fixes
This commit is contained in:
Bill Zimmerman 2023-02-08 16:09:04 +01:00 committed by GitHub
commit 2dcdbbd34e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View File

@ -133,8 +133,6 @@ function validateDHCPInput()
} }
if (!filter_var($_POST['DefaultGateway'], FILTER_VALIDATE_IP) && !empty($_POST['DefaultGateway'])) { if (!filter_var($_POST['DefaultGateway'], FILTER_VALIDATE_IP) && !empty($_POST['DefaultGateway'])) {
$errors .= _('Invalid default gateway.').'<br />'.PHP_EOL; $errors .= _('Invalid default gateway.').'<br />'.PHP_EOL;
var_dump($_POST['DefaultGateway']);
die();
} }
if (($_POST['dhcp-iface'] == "1")) { if (($_POST['dhcp-iface'] == "1")) {
if (!filter_var($_POST['RangeStart'], FILTER_VALIDATE_IP) && !empty($_POST['RangeStart'])) { if (!filter_var($_POST['RangeStart'], FILTER_VALIDATE_IP) && !empty($_POST['RangeStart'])) {

View File

@ -448,8 +448,8 @@ function ParseConfig($arrConfig)
*/ */
function getNetConfig($interface) function getNetConfig($interface)
{ {
$URI = $_SERVER['REQUEST_SCHEME'].'://'.$_SERVER['SERVER_NAME'] .'/ajax/networking/get_netcfg.php?iface='.$interface; $URI = $_SERVER['REQUEST_SCHEME'].'://' .'localhost'. dirname($_SERVER['SCRIPT_NAME']) .'/ajax/networking/get_netcfg.php?iface='.$interface;
$jsonData = file_get_contents($URI); $jsonData = file_get_contents($URI, true);
return $jsonData; return $jsonData;
} }
@ -757,7 +757,8 @@ function qr_encode($str)
return preg_replace('/(?<!\\\)([\":;,])/', '\\\\\1', $str); return preg_replace('/(?<!\\\)([\":;,])/', '\\\\\1', $str);
} }
function evalHexSequence($string) { function evalHexSequence($string)
{
$evaluator = function ($input) { $evaluator = function ($input) {
return hex2bin($input[1]); return hex2bin($input[1]);
}; };

View File

@ -27,7 +27,7 @@
</div><!-- /.card-header --> </div><!-- /.card-header -->
<div class="card-body"> <div class="card-body">
<?php $status->showMessages(); ?> <?php $status->showMessages(); ?>
<form role="form" action="/wg_conf" enctype="multipart/form-data" method="POST"> <form role="form" action="wg_conf" enctype="multipart/form-data" method="POST">
<?php echo CSRFTokenFieldTag() ?> <?php echo CSRFTokenFieldTag() ?>
<!-- Nav tabs --> <!-- Nav tabs -->
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">