trongate / trongate-framework

The Trongate PHP framework
https://trongate.io
Other
1.11k stars 100 forks source link

Fix to Core.php to permit serving child module assets #192

Closed monkeysdocode closed 1 month ago

monkeysdocode commented 1 month ago

File.php : correct variable names in write() function.

Core.php:

The new sanitize_file_path() function prevents child module assets from being found.

This modification fixes that issue and returns the child module asset path, making the serve_child_module_asset() function redundant so a good chunk of code can be removed from Core.php

I've added a boolean variable $is_child_module to sanitize_file_path() so that we can loop back, setting it to true to check the path to a child module asset if nothing's found in the parent module.

I've also added a 404 http response code if the file path is invalid.

trongate commented 1 month ago

Thank you. Hail monkeysdocode!