Skip to content

Fix #175 Update adds version info to node windows#176

Merged
jwaisner merged 1 commit intomainfrom
node-terminal
Dec 16, 2025
Merged

Fix #175 Update adds version info to node windows#176
jwaisner merged 1 commit intomainfrom
node-terminal

Conversation

@N6REJ
Copy link
Contributor

@N6REJ N6REJ commented Dec 15, 2025

PR Type

Bug fix, Enhancement


Description

  • Add $bearsamppRoot global variable to Node.js menu function

  • Change Node.js console glyph from PowerShell to Node.js icon

  • Update getItemPowerShell() call with additional parameters for path and null value

  • Fix Node.js terminal window display and version information handling


Diagram Walkthrough

flowchart LR
  A["getMenuNodejs function"] -->|Add global| B["$bearsamppRoot variable"]
  A -->|Update glyph| C["GLYPH_NODEJS icon"]
  A -->|Extend parameters| D["getItemPowerShell call"]
  D -->|Include| E["www path and null value"]
Loading

File Walkthrough

Relevant files
Bug fix
class.tpl.app.nodejs.php
Update Node.js menu with proper globals and glyph               

core/classes/tpls/app/class.tpl.app.nodejs.php

  • Added $bearsamppRoot to global variables in getMenuNodejs() method
  • Changed console glyph from GLYPH_POWERSHELL to GLYPH_NODEJS for proper
    Node.js icon display
  • Updated getItemPowerShell() call signature with additional parameters:
    $bearsamppRoot->getWwwPath() and null
  • Reorganized parameter order to include path information for Node.js
    terminal window
+6/-3     

adds version info to node windows
@N6REJ N6REJ added the bug 🐛 For known bugs label Dec 15, 2025
@qodo-code-review
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
PowerShell argument injection

Description: Possible command/argument injection risk if TplAestan::getItemPowerShell() uses the newly
passed working directory ($bearsamppRoot->getWwwPath()) or tab title to construct a
PowerShell command line without proper escaping/quoting, allowing a manipulated path
(e.g., containing &, ;, or quotes) to alter the executed command.
class.tpl.app.nodejs.php [98-105]

Referred Code
$resultItems .= TplAestan::getItemPowerShell(
    $bearsamppLang->getValue(Lang::CONSOLE),
    TplAestan::GLYPH_NODEJS,
    null,
    $bearsamppTools->getPowerShell()->getTabTitleNodejs(),
    $bearsamppRoot->getWwwPath(),
    null
) . PHP_EOL;
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Null handling missing: The new use of global bearsamppRoot and call to $bearsamppRoot->getWwwPath() has no
visible null/availability checks, which could cause failures if the global is not
initialized in some execution contexts.

Referred Code
global $bearsamppBins, $bearsamppLang, $bearsamppTools, $bearsamppRoot;
$resultItems = $resultActions = '';

$isEnabled = $bearsamppBins->getNodejs()->isEnable();

// Download
$resultItems .= TplAestan::getItemLink(
    $bearsamppLang->getValue(Lang::DOWNLOAD_MORE),
    Util::getWebsiteUrl('module/nodejs', '#releases'),
    false,
    TplAestan::GLYPH_BROWSER
) . PHP_EOL;

// Enable
$tplEnable = TplApp::getActionMulti(
    self::ACTION_ENABLE,
    array($isEnabled ? Config::DISABLED : Config::ENABLED),
    array($bearsamppLang->getValue(Lang::MENU_ENABLE), $isEnabled ? TplAestan::GLYPH_CHECK : ''),
    false,
    get_called_class()
);


 ... (clipped 24 lines)

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status:
Path trust assumption: The new $bearsamppRoot->getWwwPath() parameter passed into
TplAestan::getItemPowerShell() assumes the path source is always safe/validated, which
cannot be confirmed from the diff and may affect command invocation safety depending on
getItemPowerShell() implementation.

Referred Code
$resultItems .= TplAestan::getItemPowerShell(
    $bearsamppLang->getValue(Lang::CONSOLE),
    TplAestan::GLYPH_NODEJS,
    null,
    $bearsamppTools->getPowerShell()->getTabTitleNodejs(),
    $bearsamppRoot->getWwwPath(),
    null
) . PHP_EOL;

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Prevent fatal error on null object

Add a null check for the $bearsamppRoot variable before calling getWwwPath() to
prevent a potential fatal error if the global variable is not initialized.

core/classes/tpls/app/class.tpl.app.nodejs.php [98-105]

 TplAestan::getItemPowerShell(
     $bearsamppLang->getValue(Lang::CONSOLE),
     TplAestan::GLYPH_NODEJS,
     null,
     $bearsamppTools->getPowerShell()->getTabTitleNodejs(),
-    $bearsamppRoot->getWwwPath(),
+    $bearsamppRoot ? $bearsamppRoot->getWwwPath() : null,
     null
 )

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies that the newly introduced global variable $bearsamppRoot could be null, which would cause a fatal error, and provides a valid fix to prevent a crash.

Medium
  • More

@jwaisner jwaisner merged commit ff4970d into main Dec 16, 2025
3 checks passed
@jwaisner jwaisner deleted the node-terminal branch December 16, 2025 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐛 For known bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants