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

Fix display of non-ASCII SSID

This commit is contained in:
zbchristian 2021-08-18 22:10:33 +02:00
parent 3aa564cdec
commit 7344c323ee
4 changed files with 5 additions and 2 deletions

View File

@ -14,6 +14,7 @@ knownWifiStations($networks);
nearbyWifiStations($networks, !isset($_REQUEST["refresh"])); nearbyWifiStations($networks, !isset($_REQUEST["refresh"]));
connectedWifiStations($networks); connectedWifiStations($networks);
sortNetworksByRSSI($networks); sortNetworksByRSSI($networks);
foreach ($networks as $ssid => $network) $networks[$ssid]["ssidutf8"] = ssid2utf8( $ssid );
$connected = array_filter($networks, function($n) { return $n['connected']; } ); $connected = array_filter($networks, function($n) { return $n['connected']; } );
$known = array_filter($networks, function($n) { return !$n['connected'] && $n['configured']; } ); $known = array_filter($networks, function($n) { return !$n['connected'] && $n['configured']; } );

View File

@ -1,6 +1,7 @@
<?php <?php
require_once 'includes/functions.php'; require_once 'includes/functions.php';
require_once 'includes/wifi_functions.php';
function getClients($simple=true) function getClients($simple=true)
{ {
@ -73,6 +74,7 @@ function getClients($simple=true)
if (!$simple && !empty($ssid=preg_only_match("/.*SSID:\s*([^\"]*).*/", $retiw)) ) { if (!$simple && !empty($ssid=preg_only_match("/.*SSID:\s*([^\"]*).*/", $retiw)) ) {
$cl["device"][$i]["connected"] = "y"; $cl["device"][$i]["connected"] = "y";
$cl["device"][$i]["ssid"] = $ssid; $cl["device"][$i]["ssid"] = $ssid;
$cl["device"][$i]["ssidutf8"] = ssid2utf8($ssid);
$cl["device"][$i]["ap-mac"] = preg_only_match("/^Connected to ([0-9a-f\:]*).*$/", $retiw); $cl["device"][$i]["ap-mac"] = preg_only_match("/^Connected to ([0-9a-f\:]*).*$/", $retiw);
$sig = preg_only_match("/.*signal: (.*)$/", $retiw); $sig = preg_only_match("/.*signal: (.*)$/", $retiw);
$val = preg_only_match("/^([0-9\.-]*).*$/", $sig); $val = preg_only_match("/^([0-9\.-]*).*$/", $sig);

View File

@ -38,7 +38,7 @@
<?php $valEcho=function($cl,$id) {$val = isset($cl[$id])&& !empty($cl[$id]) ? $cl[$id] : "-"; echo htmlspecialchars($val,ENT_QUOTES);} ?> <?php $valEcho=function($cl,$id) {$val = isset($cl[$id])&& !empty($cl[$id]) ? $cl[$id] : "-"; echo htmlspecialchars($val,ENT_QUOTES);} ?>
<?php if ($clientinfo["type"] == "wlan") : // WIRELESS ?> <?php if ($clientinfo["type"] == "wlan") : // WIRELESS ?>
<div class="row mb-1"> <div class="row mb-1">
<div class="info-item col-xs-3"><?php echo _("Connected To"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"ssid"); ?></div> <div class="info-item col-xs-3"><?php echo _("Connected To"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"ssidutf8"); ?></div>
</div> </div>
<div class="row mb-1"> <div class="row mb-1">
<div class="info-item col-xs-3"><?php echo _("AP Mac Address"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"ap-mac"); ?></div> <div class="info-item col-xs-3"><?php echo _("AP Mac Address"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"ap-mac"); ?></div>

View File

@ -4,7 +4,7 @@
<?php if (strlen($network['ssid']) == 0) { <?php if (strlen($network['ssid']) == 0) {
$network['ssid'] = "(unknown)"; $network['ssid'] = "(unknown)";
} ?> } ?>
<h5 class="card-title"><?php echo htmlspecialchars($network['ssid'], ENT_QUOTES); ?></h5> <h5 class="card-title"><?php echo htmlspecialchars($network['ssidutf8'], ENT_QUOTES); ?></h5>
<div class="info-item-wifi"><?php echo _("Status"); ?></div> <div class="info-item-wifi"><?php echo _("Status"); ?></div>
<div> <div>