summaryrefslogtreecommitdiffstats
path: root/modules-available/serversetup-bwlp-ipxe/page.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2019-12-10 15:10:31 +0100
committerSimon Rettberg2019-12-10 15:10:31 +0100
commite7cc4e9d0e9a40274c8e337d0330e19dc450d929 (patch)
tree9b4e1721a3f383811d06ce7b1a26466d93548dd9 /modules-available/serversetup-bwlp-ipxe/page.inc.php
parent[minilinux] Remove debug output (diff)
downloadslx-admin-e7cc4e9d0e9a40274c8e337d0330e19dc450d929.tar.gz
slx-admin-e7cc4e9d0e9a40274c8e337d0330e19dc450d929.tar.xz
slx-admin-e7cc4e9d0e9a40274c8e337d0330e19dc450d929.zip
[serversetup-bwlp-ipxe/minilinux] Add comments, fix minor logic bug
Saving a boot entry didn't properly check the validity of a hook's ID, which was broken anyways, so the invalid check didn't uncover that the actual cheking code didn't work either.
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/page.inc.php')
-rw-r--r--modules-available/serversetup-bwlp-ipxe/page.inc.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/page.inc.php b/modules-available/serversetup-bwlp-ipxe/page.inc.php
index cc5fdbe5..a636665e 100644
--- a/modules-available/serversetup-bwlp-ipxe/page.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/page.inc.php
@@ -527,7 +527,7 @@ class Page_ServerSetup extends Page
if ($he->moduleId === $row['module']) {
$he->setSelected($row['data']);
$he->checked = 'checked';
- if ($he->getBootEntry($row['data']) === null) {
+ if (!$he->isValidId($he->getSelected())) {
Message::addError('invalid-custom-entry-id', $row['module'], $row['data']);
}
break;
@@ -848,8 +848,7 @@ class Page_ServerSetup extends Page
/** @var BootEntryHook $module */
$module = $hook->run();
$id = Request::post('selection-' . $type, false, 'string');
- $entry = $module->isValidId($id);
- if ($entry === null) {
+ if (!$module->isValidId($id)) {
Message::addError('invalid-custom-entry-id', $type, $id);
return;
}