-
Notifications
You must be signed in to change notification settings - Fork 370
Closed
Labels
[Feature] PHP.wasm[Package][@php-wasm] Universal[Priority] High[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
If a static file is under a directory tree where an ancestor directory has a name ending in ".php" (e.g., /root/some.php/assets/photo.jpeg), Playground will say that the file seems like a PHP file:
wordpress-playground/packages/php-wasm/universal/src/lib/php-request-handler.ts
Lines 595 to 597 in 7d62755
| function seemsLikeAPHPFile(path: string) { | |
| return path.endsWith('.php') || path.includes('.php/'); | |
| } |
And IIUC Playground will try to run such non-PHP files as PHP:
wordpress-playground/packages/php-wasm/universal/src/lib/php-request-handler.ts
Lines 315 to 321 in 7d62755
| if (!seemsLikeAPHPRequestHandlerPath(fsPath)) { | |
| return this.#serveStaticFile( | |
| await this.processManager.getPrimaryPhp(), | |
| fsPath | |
| ); | |
| } | |
| return this.#spawnPHPAndDispatchRequest(request, requestedUrl); |
Discovered when investigating #1332.
Metadata
Metadata
Assignees
Labels
[Feature] PHP.wasm[Package][@php-wasm] Universal[Priority] High[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended