Skip to content

Commit 2b0c3be

Browse files
committed
docs: warn against user-controlled image paths
1 parent 5e3ab98 commit 2b0c3be

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

user_guide_src/source/libraries/images.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ The available Handlers are as follows:
4242
On Windows, the ImageMagick handler requires **absolute file paths** when
4343
loading images (for example, using ``WRITEPATH`` or ``FCPATH``).
4444

45+
.. warning::
46+
Do not let user input directly decide the image source path, storage
47+
directory, or filename. This includes values passed to methods like
48+
``save()``, ``copy()`` and others, and any path or filename used to store
49+
processed images. Use directories controlled by your application, and
50+
generate filenames yourself or sanitize them with
51+
:php:func:`sanitize_filename`.
52+
4553
*******************
4654
Processing an Image
4755
*******************

0 commit comments

Comments
 (0)