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

Merge pull request #355 from glaszig/ui/escape-interface-settings

show network interface settings pre block, properly escaped
This commit is contained in:
Bill Zimmerman 2019-08-02 18:25:27 +02:00 committed by GitHub
commit 02c3703392
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -5,6 +5,7 @@ include_once('../../includes/functions.php');
if(isset($_POST['interface']) && isset($_POST['csrf_token']) && CSRFValidate()) {
$int = preg_replace('/[^a-z0-9]/','',$_POST['interface']);
exec('ip a s '.$int,$intOutput,$intResult);
$intOutput = array_map('htmlentities', $intOutput);
$jsonData = ['return'=>$intResult,'output'=>$intOutput];
echo json_encode($jsonData);
} else {

8
dist/css/custom.css vendored
View File

@ -54,6 +54,12 @@
height:300px;
}
pre.unstyled {
border-width: 0;
background-color: transparent;
padding: 0;
}
.dhcp-static-leases {
margin-top: 1em;
margin-bottom: 1em;
@ -62,4 +68,4 @@
.dhcp-static-lease-row {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
}

View File

@ -44,7 +44,9 @@ function DisplayNetworkingConfig()
echo '<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">'.htmlspecialchars($interface, ENT_QUOTES).'</div>
<div class="panel-body" id="'.htmlspecialchars($interface, ENT_QUOTES).'-summary"></div>
<div class="panel-body">
<pre class="unstyled" id="'.htmlspecialchars($interface, ENT_QUOTES).'-summary"></pre>
</div>
</div>
</div>';
}