Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions emhttp/plugins/dynamix/BootInfo.page
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Tag="usb"
* all copies or substantial portions of the Software.
*/
?>
<?$tpmEnabled = is_dir('/sys/class/tpm/tpm0');?>
<script>
function cleanUp(zip) {
if (document.hasFocus()) {
Expand Down Expand Up @@ -54,6 +55,14 @@ _(Flash Product)_:
_(Flash GUID)_:
: <?=htmlspecialchars($var['flashGUID'] ?? '', ENT_QUOTES, 'UTF-8');?>&nbsp;

<?if ($tpmEnabled):?>
_(TPM Licensing)_:
: _(TPM licensing is available.)_

_(TPM GUID)_:
: <?=htmlspecialchars($var['tpmGUID'] ?? '', ENT_QUOTES, 'UTF-8');?>&nbsp;
<?endif;?>
Comment on lines +58 to +64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Guard TPM messaging on actual GUID presence.

This block can currently show “TPM licensing is available.” even when tpmGUID is empty. Consider requiring a non-empty GUID before rendering the TPM section to avoid contradictory UI state.

Suggested adjustment
-<?if ($tpmEnabled):?>
+<?$tpmGuid = trim((string)($var['tpmGUID'] ?? ''));?>
+<?if ($tpmEnabled && $tpmGuid !== ''):?>
 _(TPM Licensing)_:
 : _(TPM licensing is available.)_
 
 _(TPM GUID)_:
-: <?=htmlspecialchars($var['tpmGUID'] ?? '', ENT_QUOTES, 'UTF-8');?>&nbsp;
+: <?=htmlspecialchars($tpmGuid, ENT_QUOTES, 'UTF-8');?>&nbsp;
 <?endif;?>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<?if ($tpmEnabled):?>
_(TPM Licensing)_:
: _(TPM licensing is available.)_
_(TPM GUID)_:
: <?=htmlspecialchars($var['tpmGUID'] ?? '', ENT_QUOTES, 'UTF-8');?>&nbsp;
<?endif;?>
<?$tpmGuid = trim((string)($var['tpmGUID'] ?? ''));?>
<?if ($tpmEnabled && $tpmGuid !== ''):?>
_(TPM Licensing)_:
: _(TPM licensing is available.)_
_(TPM GUID)_:
: <?=htmlspecialchars($tpmGuid, ENT_QUOTES, 'UTF-8');?>&nbsp;
<?endif;?>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@emhttp/plugins/dynamix/BootInfo.page` around lines 58 - 64, The TPM section
is shown when $tpmEnabled is true even if $var['tpmGUID'] is empty; change the
guard to require a non-empty GUID (e.g. check !empty(trim($var['tpmGUID'])))
before rendering the TPM block so the "TPM licensing is available." message and
GUID label only appear when a real GUID exists; update the conditional around
the TPM block (referenced by $tpmEnabled and $var['tpmGUID']) to include this
check and leave the htmlspecialchars output as-is.



<?if (strstr($var['regTy'], "blacklisted")):?>

Expand Down
Loading