fix: resolve relative SystemUtility includes in installer AJAX endpoint - #845
Open
ocjorge wants to merge 1 commit into
Open
fix: resolve relative SystemUtility includes in installer AJAX endpoint#845ocjorge wants to merge 1 commit into
ocjorge wants to merge 1 commit into
Conversation
Replace four repeated relative include_once('lib/SystemUtility.php')
calls inside individual else blocks with a single include_once using
LEGACY_ROOT at the top of the resumeParsing case.
Relative includes can fail when the endpoint is accessed directly from
a different working directory. This was noted as a pre-existing issue
in PR opencats#797.
There was a problem hiding this comment.
🟢 Approval recommended
The change is narrowly scoped, consistent with existing LEGACY_ROOT include usage in the same file, and removes a confirmed source of brittle relative includes without altering behavior.
Pull request overview
This PR fixes a legacy relative-include problem in the installer’s resumeParsing AJAX action by switching SystemUtility loading to a LEGACY_ROOT-anchored path, making the endpoint resilient when executed from different working directories.
Changes:
- Added a single
include_once(LEGACY_ROOT . '/lib/SystemUtility.php')at the start of theresumeParsingcase. - Removed four redundant relative
include_once('lib/SystemUtility.php')calls from individual branches withinresumeParsing.
File summaries
| File | Description |
|---|---|
| modules/install/ajax/ui.php | Replaces repeated relative SystemUtility.php includes with one root-based include within resumeParsing to prevent direct-access include failures. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The
resumeParsingcase inmodules/install/ajax/ui.phpcontainedfour repeated relative
include_once('lib/SystemUtility.php')callsinside individual
elseblocks. Relative includes can fail when theendpoint is accessed directly from a different working directory.
Solution
Replace the four repeated relative includes with a single
include_once(LEGACY_ROOT . '/lib/SystemUtility.php')at the top ofthe
resumeParsingcase, before the conditional blocks.This also removes the redundancy —
include_onceonly loads the fileonce anyway, so four calls in separate branches were unnecessary.
Context
This was noted as a pre-existing issue in PR #797: