Fix #45: PHAR unable to access local endpoints#46
Merged
Conversation
Sync the action whitelist with Application::setupRoutes() so that ?action=sse_files requests are no longer silently dropped to 'home'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ntroller The form sent 'filename' but BigDumpController::delete() reads 'delete'. Replace with <a href="?delete=FILENAME"> to match both the controller and the pattern already used in filepolling.js. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The regex now matches both /index.php and /anything.phar so that PHAR-mode requests get a clean base URI for link generation. Adds RequestTest.php with 8 tests covering index.php, .phar, nested paths, and non-matching paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
$scriptUri resolves to the parent directory (/tools) which breaks navigation in PHAR mode. $scriptName points to the PHAR file itself (bigdump.phar), giving a correct home link. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In PHAR mode icons are inlined in the DOM, so <use> elements must reference fragments (#id) instead of external files (assets/icons2.svg#id). - Add iconRef(string $id) to View.php - Replace all 15 hardcoded icon paths in home.php with the helper Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sync the action whitelist with Application::setupRoutes() so that ?action=sse_files requests are no longer silently dropped to 'home'. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ntroller The form sent 'filename' but BigDumpController::delete() reads 'delete'. Replace with <a href="?delete=FILENAME"> to match both the controller and the pattern already used in filepolling.js. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The regex now matches both /index.php and /anything.phar so that PHAR-mode requests get a clean base URI for link generation. Adds RequestTest.php with 8 tests covering index.php, .phar, nested paths, and non-matching paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
$scriptUri resolves to the parent directory (/tools) which breaks navigation in PHAR mode. $scriptName points to the PHAR file itself (bigdump.phar), giving a correct home link. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
In PHAR mode icons are inlined in the DOM, so <use> elements must reference fragments (#id) instead of external files (assets/icons2.svg#id). - Add iconRef(string $id) to View.php - Replace all 15 hardcoded icon paths in home.php with the helper Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Fixes issue #45
Problem
PHAR build (v2.28) unable to access local endpoints — file list polling, preview, history, and import all broken. Also affects traditional installation for some actions.
Root Cause Analysis
5 bugs identified, mostly routing/URL regressions since v2.24:
sse_filesregistered in Router but absent fromRequest::determineAction()validationfilenamefield, controller readsdeleteparametergetScriptUri()only strips/index.php, not.pharentry pointshref="./"resolves to parent directory instead of PHAR filehref="assets/icons.svg#..."fails since icons are inlined in PHAR modeChanges
src/Core/Request.php— Addsse_filesto validActions, fixgetScriptUri()regex for.phartemplates/home.php— Replace broken POST delete form with GET link matching controllertemplates/layout_phar.php— Use$scriptNamefor home linksrc/Core/View.php— AddiconRef()helper for PHAR-compatible SVG referencesTesting