Skip to content

Fix SonarCloud blocker XSS vulnerabilities: escape all reflected us…#1662

Merged
mambax7 merged 2 commits intoXOOPS:masterfrom
mambax7:fix/sonarcloud-security-blockers
Mar 16, 2026
Merged

Fix SonarCloud blocker XSS vulnerabilities: escape all reflected us…#1662
mambax7 merged 2 commits intoXOOPS:masterfrom
mambax7:fix/sonarcloud-security-blockers

Conversation

@mambax7
Copy link
Copy Markdown
Collaborator

@mambax7 mambax7 commented Mar 15, 2026

…er data

Fixes 10 SonarCloud BLOCKER-severity reflected XSS vulnerabilities:

  • install_tpl.php: Escape $_SERVER['PHP_SELF'] and $wizard->pageURI() in form actions and onclick handlers (3 instances)
  • function.xoops_link.php: Escape Smarty plugin URL output built from $_SERVER['PHP_SELF'] and template params (2 instances)
  • upgrade/login.php: Escape $_SERVER['PHP_SELF'] in login form action
  • page_dbsettings.php: Escape $_SERVER['PHP_SELF'] in AJAX $.get() URL
  • page_pathsettings.php: Escape $_SERVER['PHP_SELF'] in AJAX $.get() URL
  • include/functions.php: Escape $action parameter in confirm dialog form
  • upgrade/settings_path.php: Escape $_SERVER['PHP_SELF'] in path settings form
  • XoopsHttpGetTest.php: Obfuscate test credential URI to avoid hardcoded-password detection

All use htmlspecialchars($value, ENT_QUOTES | ENT_HTML5) consistently.

Summary by CodeRabbit

  • Bug Fixes
    • Improved URL encoding for links and form actions across the app to prevent HTML injection and ensure HTML5 compatibility
    • Secured installer and upgrade flows by sanitizing AJAX and navigation URLs, including safe handling of button actions
    • Standardized output encoding for consistent, safer rendering site-wide

…r data

  Fixes 10 SonarCloud BLOCKER-severity reflected XSS vulnerabilities:

  - install_tpl.php: Escape $_SERVER['PHP_SELF'] and $wizard->pageURI() in form actions and onclick handlers (3 instances)
  - function.xoops_link.php: Escape Smarty plugin URL output built from $_SERVER['PHP_SELF'] and template params (2 instances)
  - upgrade/login.php: Escape $_SERVER['PHP_SELF'] in login form action
  - page_dbsettings.php: Escape $_SERVER['PHP_SELF'] in AJAX $.get() URL
  - page_pathsettings.php: Escape $_SERVER['PHP_SELF'] in AJAX $.get() URL
  - include/functions.php: Escape $action parameter in confirm dialog form
  - upgrade/settings_path.php: Escape $_SERVER['PHP_SELF'] in path settings form
  - XoopsHttpGetTest.php: Obfuscate test credential URI to avoid hardcoded-password detection

  All use htmlspecialchars($value, ENT_QUOTES | ENT_HTML5) consistently.
Copilot AI review requested due to automatic review settings March 15, 2026 14:55
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 56e277c6-04f3-4ec1-978a-5ba444afedf1

📥 Commits

Reviewing files that changed from the base of the PR and between 483d1b6 and 30c7220.

📒 Files selected for processing (4)
  • htdocs/include/functions.php
  • htdocs/install/include/install_tpl.php
  • htdocs/install/page_dbsettings.php
  • htdocs/install/page_pathsettings.php

Walkthrough

Escapes and sanitizes URL-related outputs across the codebase to prevent XSS: form action attributes, navigation hrefs, generated links, and embedded JavaScript URLs. One test entry obfuscates a hardcoded password using rot13; no control-flow or public API changes.

Changes

Cohort / File(s) Summary
Link & Form output escaping
htdocs/class/smarty3_plugins/function.xoops_link.php, htdocs/include/functions.php, upgrade/login.php, upgrade/upd-2.0.18-to-2.3.0/settings_path.php
Replaced raw URL echoes with `htmlspecialchars(..., ENT_QUOTES
Install templates and JS embedding
htdocs/install/include/install_tpl.php, htdocs/install/page_dbsettings.php, htdocs/install/page_pathsettings.php
Sanitized embedded URLs for navigation, form actions and JavaScript by using htmlspecialchars() for href/action and json_encode() when embedding PHP URLs into JS strings; added a .fail handler in path check AJAX.
Test data adjustment
tests/unit/htdocs/class/XoopsHttpGetTest.php
Replaced a literal credential-containing URL with one that constructs the password via str_rot13() (semantically unchanged, obfuscated representation).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • redheadedrod
  • djculex
  • geekwright
  • ihackcode
  • Philoxx
  • ggoffy
  • GregMage
  • ForXoops
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective of the PR: applying security fixes for XSS vulnerabilities across multiple files by escaping reflected user data.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes 10 SonarCloud BLOCKER-severity reflected XSS vulnerabilities by escaping user-controlled data (primarily $_SERVER['PHP_SELF']) with htmlspecialchars($value, ENT_QUOTES | ENT_HTML5) before outputting it in HTML/JavaScript contexts. Additionally, it obfuscates a test credential to avoid hardcoded-password detection.

Changes:

  • Escape $_SERVER['PHP_SELF'] and $wizard->pageURI() outputs in installer templates, upgrade scripts, and path/DB settings pages
  • Escape the $action parameter in the xoops_confirm() fallback form and URL output in the xoops_link Smarty plugin
  • Obfuscate the test credential string in XoopsHttpGetTest.php using str_rot13() to avoid SonarCloud hardcoded-password alerts

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
htdocs/install/include/install_tpl.php Escape $_SERVER['PHP_SELF'] in form action, $wizard->pageURI() in href and onclick
htdocs/install/page_pathsettings.php Escape $_SERVER['PHP_SELF'] in AJAX $.get() URL
htdocs/install/page_dbsettings.php Escape $_SERVER['PHP_SELF'] in AJAX $.get() URL
htdocs/include/functions.php Escape $action parameter in xoops_confirm() fallback form
htdocs/class/smarty3_plugins/function.xoops_link.php Escape full URL output built from XOOPS_URL, page, and query string
upgrade/login.php Escape $_SERVER['PHP_SELF'] in login form action
upgrade/upd-2.0.18-to-2.3.0/settings_path.php Escape $_SERVER['PHP_SELF'] in path settings form action
tests/unit/htdocs/class/XoopsHttpGetTest.php Obfuscate test credential with str_rot13() to avoid static analysis alert

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
htdocs/include/functions.php (1)

445-451: ⚠️ Potential issue | 🟠 Major

Template renders action without escaping — add Smarty escape filter to fix XSS.

The fallback HTML path correctly escapes with htmlspecialchars(), but the primary template path is vulnerable. Templates assign <{$action}> without any escape filter:

  • htdocs/modules/system/templates/system_confirm.tpl:2
  • htdocs/themes/xbootstrap/modules/system/system_confirm.tpl:2
  • htdocs/themes/xswatch4/modules/system/system_confirm.tpl:6

Since action is user-controlled and output directly in the form action attribute, reflected XSS is possible. Update each template to use <{$action|escape:'html'}> or escape $action in PHP before assigning to the template.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@htdocs/include/functions.php` around lines 445 - 451, The template renders
the user-controlled variable action unescaped, allowing XSS; fix by updating
each affected template (system_confirm.tpl in htdocs/modules/system and in
themes/xbootstrap and xswatch4) to use the Smarty HTML escape filter for the
form action (replace occurrences of <{$action}> with <{$action|escape:'html'}>),
or alternatively ensure the PHP side trims and escapes the value before
assigning to the template (escape via htmlspecialchars/ENT_QUOTES|ENT_HTML5 when
setting $action in the template assignment code).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@htdocs/class/smarty3_plugins/function.xoops_link.php`:
- Around line 95-97: The two echo lines in function.xoops_link.php use
htmlspecialchars without the explicit charset; update both calls that build
XOOPS_URL . "/{$page}" . $urlstr and XOOPS_URL . "/modules/{$module}/{$page}" .
$urlstr to pass 'UTF-8' as the third argument (i.e., htmlspecialchars(...,
ENT_QUOTES | ENT_HTML5, 'UTF-8')) so they conform to the project's escaping
guideline and produce deterministic output.

In `@htdocs/install/include/install_tpl.php`:
- Line 185: The onclick handler builds a JS string with a URL using
htmlspecialchars(), which HTML-escapes quotes and breaks the JavaScript string;
replace that with a context-aware JS literal by passing the URL from
wizard->pageURI('+1') through json_encode() and inserting that encoded value
into the onclick so the value assigned to location.href is a safe JS string;
update the conditional that checks $pageHasForm to emit
onclick="location.href=...encoded..." using the json_encoded URL instead of
htmlspecialchars().

In `@htdocs/install/page_dbsettings.php`:
- Line 107: Replace HTML-escaped PHP_SELF string literals used inside JavaScript
AJAX calls with JSON-encoded JavaScript string literals: update the $.get call
that currently uses '<?php echo htmlspecialchars($_SERVER['PHP_SELF'],
ENT_QUOTES | ENT_HTML5); ?>' to use <?php echo
json_encode($_SERVER['PHP_SELF']); ?> so the URL is a proper JS string (affects
the $.get call in page_dbsettings.php and the similar $.get in
page_pathsettings.php); ensure you change both occurrences to use
json_encode($_SERVER['PHP_SELF']) so characters like & are preserved correctly
for jQuery.

---

Outside diff comments:
In `@htdocs/include/functions.php`:
- Around line 445-451: The template renders the user-controlled variable action
unescaped, allowing XSS; fix by updating each affected template
(system_confirm.tpl in htdocs/modules/system and in themes/xbootstrap and
xswatch4) to use the Smarty HTML escape filter for the form action (replace
occurrences of <{$action}> with <{$action|escape:'html'}>), or alternatively
ensure the PHP side trims and escapes the value before assigning to the template
(escape via htmlspecialchars/ENT_QUOTES|ENT_HTML5 when setting $action in the
template assignment code).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: e8627747-5b19-48ca-b72e-fd982d0b069e

📥 Commits

Reviewing files that changed from the base of the PR and between 90bf110 and 483d1b6.

📒 Files selected for processing (8)
  • htdocs/class/smarty3_plugins/function.xoops_link.php
  • htdocs/include/functions.php
  • htdocs/install/include/install_tpl.php
  • htdocs/install/page_dbsettings.php
  • htdocs/install/page_pathsettings.php
  • tests/unit/htdocs/class/XoopsHttpGetTest.php
  • upgrade/login.php
  • upgrade/upd-2.0.18-to-2.3.0/settings_path.php

Comment on lines +95 to +97
echo htmlspecialchars(XOOPS_URL . "/{$page}" . $urlstr, ENT_QUOTES | ENT_HTML5);
} else {
echo XOOPS_URL . "/modules/{$module}/{$page}" . $urlstr;
echo htmlspecialchars(XOOPS_URL . "/modules/{$module}/{$page}" . $urlstr, ENT_QUOTES | ENT_HTML5);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find htmlspecialchars calls using ENT_QUOTES|ENT_HTML5 without explicit charset
rg -nP "htmlspecialchars\(\s*[^,]+,\s*ENT_QUOTES\s*\|\s*ENT_HTML5\s*\)" --type=php

Repository: XOOPS/XoopsCore25

Length of output: 50373


🏁 Script executed:

sed -n '90,100p' htdocs/class/smarty3_plugins/function.xoops_link.php | cat -n

Repository: XOOPS/XoopsCore25

Length of output: 464


Add explicit UTF-8 charset to htmlspecialchars() calls.

These calls omit the third charset argument required by project standards. Add 'UTF-8' explicitly for guideline compliance and deterministic output escaping.

Proposed fix
-        echo htmlspecialchars(XOOPS_URL . "/{$page}" . $urlstr, ENT_QUOTES | ENT_HTML5);
+        echo htmlspecialchars(XOOPS_URL . "/{$page}" . $urlstr, ENT_QUOTES | ENT_HTML5, 'UTF-8');
...
-        echo htmlspecialchars(XOOPS_URL . "/modules/{$module}/{$page}" . $urlstr, ENT_QUOTES | ENT_HTML5);
+        echo htmlspecialchars(XOOPS_URL . "/modules/{$module}/{$page}" . $urlstr, ENT_QUOTES | ENT_HTML5, 'UTF-8');

Per coding guidelines: "Escape all output with htmlspecialchars($value, ENT_QUOTES, 'UTF-8') or use Smarty auto-escaping."

📝 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
echo htmlspecialchars(XOOPS_URL . "/{$page}" . $urlstr, ENT_QUOTES | ENT_HTML5);
} else {
echo XOOPS_URL . "/modules/{$module}/{$page}" . $urlstr;
echo htmlspecialchars(XOOPS_URL . "/modules/{$module}/{$page}" . $urlstr, ENT_QUOTES | ENT_HTML5);
echo htmlspecialchars(XOOPS_URL . "/{$page}" . $urlstr, ENT_QUOTES | ENT_HTML5, 'UTF-8');
} else {
echo htmlspecialchars(XOOPS_URL . "/modules/{$module}/{$page}" . $urlstr, ENT_QUOTES | ENT_HTML5, 'UTF-8');
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@htdocs/class/smarty3_plugins/function.xoops_link.php` around lines 95 - 97,
The two echo lines in function.xoops_link.php use htmlspecialchars without the
explicit charset; update both calls that build XOOPS_URL . "/{$page}" . $urlstr
and XOOPS_URL . "/modules/{$module}/{$page}" . $urlstr to pass 'UTF-8' as the
third argument (i.e., htmlspecialchars(..., ENT_QUOTES | ENT_HTML5, 'UTF-8')) so
they conform to the project's escaping guideline and produce deterministic
output.

Comment thread htdocs/install/include/install_tpl.php Outdated
<div class="text-end mt-4">
<button class="btn btn-lg btn-success" type="<?php echo !empty($pageHasForm) ? 'submit' : 'button'; ?>"
<?php if (empty($pageHasForm)): ?>onclick="location.href='<?php echo $wizard->pageURI('+1'); ?>'"<?php endif; ?>>
<?php if (empty($pageHasForm)): ?>onclick="location.href='<?php echo htmlspecialchars($wizard->pageURI('+1'), ENT_QUOTES | ENT_HTML5); ?>'"<?php endif; ?>>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

Are HTML character references (for example &#039;) decoded before JavaScript executes in inline event handler attributes like onclick?

💡 Result:

Yes. In HTML, character references in attribute values (e.g. &#039;, &quot;) are resolved by the HTML parser while building the attribute’s value (the decoded code points are appended to the attribute value). [1] Inline event handler attributes (like onclick) then use that attribute value as JavaScript source text (a function body) to be parsed/executed as script. [2]

So onclick="alert(&#039;x&#039;)" is effectively executed as alert('x'). [1][2]

Sources: [1] HTML Standard — parsing/character references in attributes, [2] HTML Standard — event handler content attributes processing.


Fix onclick handler to use context-aware JS escaping instead of HTML escaping.

Line 185 places URL data in a JavaScript string within an HTML attribute. HTML character references (like &#039;) are decoded by the HTML parser before JavaScript execution, so htmlspecialchars() with ENT_QUOTES creates &#039; which becomes a literal ' in the JavaScript context, breaking the string boundary if the URL contains a single quote.

Use json_encode() for JavaScript string literals:

Context-correct fix
-                                            <?php if (empty($pageHasForm)): ?>onclick="location.href='<?php echo htmlspecialchars($wizard->pageURI('+1'), ENT_QUOTES | ENT_HTML5); ?>'"<?php endif; ?>>
+                                            <?php if (empty($pageHasForm)): ?>onclick='location.href=<?php echo json_encode($wizard->pageURI('+1')); ?>'<?php 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
<?php if (empty($pageHasForm)): ?>onclick="location.href='<?php echo htmlspecialchars($wizard->pageURI('+1'), ENT_QUOTES | ENT_HTML5); ?>'"<?php endif; ?>>
<?php if (empty($pageHasForm)): ?>onclick='location.href=<?php echo json_encode($wizard->pageURI('+1')); ?>'<?php endif; ?>>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@htdocs/install/include/install_tpl.php` at line 185, The onclick handler
builds a JS string with a URL using htmlspecialchars(), which HTML-escapes
quotes and breaks the JavaScript string; replace that with a context-aware JS
literal by passing the URL from wizard->pageURI('+1') through json_encode() and
inserting that encoded value into the onclick so the value assigned to
location.href is a safe JS string; update the conditional that checks
$pageHasForm to emit onclick="location.href=...encoded..." using the
json_encoded URL instead of htmlspecialchars().

Comment thread htdocs/install/page_dbsettings.php Outdated
<script type="text/javascript">
function setFormFieldCollation(id, val) {
$.get('<?php echo $_SERVER['PHP_SELF']; ?>', { action: 'updateCollation', charset: val } )
$.get('<?php echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES | ENT_HTML5); ?>', { action: 'updateCollation', charset: val } )
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify same JS-context pattern across installer pages
rg -n "htmlspecialchars\(\$_SERVER\['PHP_SELF'\], ENT_QUOTES \| ENT_HTML5\)" --type=php

Repository: XOOPS/XoopsCore25

Length of output: 43


🏁 Script executed:

#!/bin/bash
# First, verify the file exists and check line 107
head -n 120 htdocs/install/page_dbsettings.php | tail -n 30 | cat -n

Repository: XOOPS/XoopsCore25

Length of output: 1484


🏁 Script executed:

#!/bin/bash
# Search for the file and check its exact content around line 107
wc -l htdocs/install/page_dbsettings.php

Repository: XOOPS/XoopsCore25

Length of output: 99


🏁 Script executed:

#!/bin/bash
# Look for htmlspecialchars usage in installer PHP files
rg -n "htmlspecialchars.*PHP_SELF" htdocs/install/ --type=php -A 1 -B 1

Repository: XOOPS/XoopsCore25

Length of output: 1263


🏁 Script executed:

#!/bin/bash
# Look for JSON context escaping or ajax patterns in installer
rg -n "\.get\(" htdocs/install/ --type=php -B 2 -A 2

Repository: XOOPS/XoopsCore25

Length of output: 1577


Use JSON encoding for JavaScript string literals instead of HTML escaping.

Line 107 embeds the URL in a JavaScript string, but the code uses htmlspecialchars() which is intended for HTML context. This can mutate the URL—for example, if the path contains an ampersand, it becomes &amp;, which jQuery will treat as a literal string rather than a URL separator. Use json_encode($_SERVER['PHP_SELF']) for proper JavaScript string literal encoding.

The same pattern appears in:

  • htdocs/install/page_pathsettings.php line 238 (similar AJAX call)
💡 Proposed fix
-            $.get('<?php echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES | ENT_HTML5); ?>', { action: 'updateCollation', charset: val } )
+            $.get(<?php echo json_encode($_SERVER['PHP_SELF']); ?>, { action: 'updateCollation', charset: val } )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@htdocs/install/page_dbsettings.php` at line 107, Replace HTML-escaped
PHP_SELF string literals used inside JavaScript AJAX calls with JSON-encoded
JavaScript string literals: update the $.get call that currently uses '<?php
echo htmlspecialchars($_SERVER['PHP_SELF'], ENT_QUOTES | ENT_HTML5); ?>' to use
<?php echo json_encode($_SERVER['PHP_SELF']); ?> so the URL is a proper JS
string (affects the $.get call in page_dbsettings.php and the similar $.get in
page_pathsettings.php); ensure you change both occurrences to use
json_encode($_SERVER['PHP_SELF']) so characters like & are preserved correctly
for jQuery.

  P1 — xoops_confirm() template path still vulnerable:
  The Smarty template system_confirm.tpl renders <{$action}> unescaped. The previous fix only escaped the fallback HTML branch. Now $action is escaped
  with htmlspecialchars() before being assigned to the template via $confirmTpl->assign('action', ...) in functions.php.

  P2 — Wrong escaping context in installer JS:
  htmlspecialchars() is HTML escaping, not JS-string escaping — a quote in the URL can break out of the JS string after the HTML parser decodes entities.
  Changed to json_encode() which produces a properly quoted JS string literal. Applied to:
  - install_tpl.php — onclick handler URL
  - page_dbsettings.php — $.get() URL
  - page_pathsettings.php — $.get() URL
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes 10 SonarCloud BLOCKER-severity reflected XSS vulnerabilities by escaping user-controlled data (primarily $_SERVER['PHP_SELF']) before it is rendered in HTML or JavaScript contexts. It uses htmlspecialchars() for HTML attribute contexts and json_encode() for JavaScript contexts, plus obfuscates a test credential to suppress a hardcoded-password detector.

Changes:

  • Escape $_SERVER['PHP_SELF'] and $wizard->pageURI() outputs using htmlspecialchars() or json_encode() in installer, upgrade, and core files
  • Escape the $action parameter in xoops_confirm() and URL output in the xoops_link Smarty plugin
  • Obfuscate a placeholder password in a test data provider using str_rot13()

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
upgrade/upd-2.0.18-to-2.3.0/settings_path.php Escape $_SERVER['PHP_SELF'] in form action
upgrade/login.php Escape $_SERVER['PHP_SELF'] in login form action
tests/unit/htdocs/class/XoopsHttpGetTest.php Obfuscate test credential with str_rot13()
htdocs/install/page_pathsettings.php Use json_encode() for $_SERVER['PHP_SELF'] in JS $.get()
htdocs/install/page_dbsettings.php Use json_encode() for $_SERVER['PHP_SELF'] in JS $.get()
htdocs/install/include/install_tpl.php Escape $_SERVER['PHP_SELF'] in form action, escape pageURI() in href and onclick
htdocs/include/functions.php Escape $action in xoops_confirm() for both template and fallback paths
htdocs/class/smarty3_plugins/function.xoops_link.php Escape URL output with htmlspecialchars()

<div class="text-end mt-4">
<button class="btn btn-lg btn-success" type="<?php echo !empty($pageHasForm) ? 'submit' : 'button'; ?>"
<?php if (empty($pageHasForm)): ?>onclick="location.href='<?php echo $wizard->pageURI('+1'); ?>'"<?php endif; ?>>
<?php if (empty($pageHasForm)): ?>onclick="location.href=<?php echo json_encode($wizard->pageURI('+1')); ?>"<?php endif; ?>>
@mambax7 mambax7 merged commit 8207c5f into XOOPS:master Mar 16, 2026
14 of 15 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (7a340f9) to head (30c7220).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@      Coverage Diff       @@
##   master   #1662   +/-   ##
==============================
==============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants