[772424][PHP 8.1][PS 8.2] Fix PrettyBlocks upload – comply with open_basedir #317
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.
[772424][PHP 8.1][PS 8.2] Fix PrettyBlocks upload – comply with open_basedir
Description
This PR fixes an image upload issue in the PrettyBlocks module on the 772424 server (PHP 8.1, PrestaShop 8.2, no overrides).
Issue
open_basedir restriction in effectwhen callingmove_uploaded_file()./...) instead of anopen_basedir-allowed directory.Fix
modules/prettyblocks/views/images/by default).realpath(), block.., remove$/prefix).Tests
_PS_ROOT_DIR_→ compliant withopen_basedir.Impact
Notes:
modules/prettyblocks/views/images/is writable bywww-data.open_basedir.