Regression #16803
open
Links to send WOL packets are not handled consistently, may fail to send
Added by Jim Pingle 1 day ago.
Updated 1 day ago.
Plus Target Version:
26.07
Description
Shortcut links to send WOL packets are present on several pages in the GUI (WOL widget, DHCP leases, ARP Table, and the WOL page itself) and they are not using the same formatting on the links to services_wol.php. As a consequence, links from some pages send WOL packets successfully and others such as diag_arp.php fail.
- Status changed from Confirmed to Feedback
- % Done changed from 0 to 100
Fixed in commit 47b9dc95c84f0f188b5fc1244d5eeaede68559f1.
The following patch can be applied to correct the issue:
diff --git a/src/usr/local/www/services_wol.php b/src/usr/local/www/services_wol.php
index 83014d78a1..f6d14828c9 100644
--- a/src/usr/local/www/services_wol.php
+++ b/src/usr/local/www/services_wol.php
@@ -69,7 +69,7 @@ if ($_POST['Submit'] || $_POST['mac']) {
if ($_POST['mac']) {
/* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
- $mac = strtolower(str_replace("-", ":", $_POST['mac']));
+ $mac = strtolower(str_replace("-", ":", urldecode($_POST['mac'])));
$if = $_POST['if'];
}
@@ -193,7 +193,7 @@ print $form;
<?=htmlspecialchars(convert_friendly_interface_to_friendly_descr($wolent['interface']));?>
</td>
<td>
- <a href="?mac=<?=$wolent['mac'];?>&if=<?=urlencode($wolent['interface']);?>" usepost><?=strtolower($wolent['mac']);?></a>
+ <a href="?mac=<?=urlencode($wolent['mac']);?>&if=<?=urlencode($wolent['interface']);?>" usepost><?=strtolower($wolent['mac']);?></a>
</td>
<td>
<?=htmlspecialchars($wolent['descr']);?>
@@ -201,7 +201,7 @@ print $form;
<td>
<a class="fa-solid fa-pencil" title="<?=gettext('Edit Device')?>" href="services_wol_edit.php?id=<?=$i?>"></a>
<a class="fa-solid fa-trash-can" title="<?=gettext('Delete Device')?>" href="services_wol.php?act=del&id=<?=$i?>" usepost></a>
- <a class="fa-solid fa-power-off" title="<?=gettext('Wake Device')?>" href="?mac=<?=$wolent['mac'];?>&if=<?=urlencode($wolent['interface']);?>" usepost></a>
+ <a class="fa-solid fa-power-off" title="<?=gettext('Wake Device')?>" href="?mac=<?=urlencode($wolent['mac']);?>&if=<?=urlencode($wolent['interface']);?>" usepost></a>
</td>
</tr>
<?php endforeach?>
diff --git a/src/usr/local/www/widgets/widgets/wake_on_lan.widget.php b/src/usr/local/www/widgets/widgets/wake_on_lan.widget.php
index 252fc9ad51..3a9f28e556 100644
--- a/src/usr/local/www/widgets/widgets/wake_on_lan.widget.php
+++ b/src/usr/local/www/widgets/widgets/wake_on_lan.widget.php
@@ -129,7 +129,7 @@ if (count($wolcomputers) > 0):
<?php endif; ?>
</td>
<td>
- <a href="services_wol.php?mac=<?= $wolent['mac'] ?>&if=<?= urlencode($wolent['interface']) ?>" usepost>
+ <a href="services_wol.php?mac=<?= urlencode($wolent['mac']) ?>&if=<?= urlencode($wolent['interface']) ?>" usepost>
<i class="fa-solid fa-power-off" data-toggle="tooltip" title="<?= gettext("Wake up!") ?>"></i>
</a>
</td>
Also available in: Atom
PDF