Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit eb17948

Browse filesBrowse files
committed
security #5287 Add a caution to the getUploadRootDir Doctrine (anacicconi)
This PR was merged into the 2.3 branch. Discussion ---------- Add a caution to the getUploadRootDir Doctrine | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | all | Fixed tickets | #4177 Commits ------- a80d669 Add a caution to the getUploadRootDir - correction 69475d0 Adding a caution to the getUploadRootDir() method
2 parents 4566d33 + a80d669 commit eb17948
Copy full SHA for eb17948

File tree

Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-0
lines changed

‎cookbook/doctrine/file_uploads.rst

Copy file name to clipboardExpand all lines: cookbook/doctrine/file_uploads.rst
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ file.
9999
If you're using annotations to specify your validation rules (as shown
100100
in this example), be sure that you've enabled validation by annotation
101101
(see :ref:`validation configuration <book-validation-configuration>`).
102+
103+
.. caution::
104+
105+
If you use the ``getUploadRootDir()`` method, be aware that this will save
106+
the file inside the document root, which can be accessed by everyone.
107+
Consider placing it out of the document root and adding custom viewing
108+
logic when you need to secure the files.
102109

103110
To handle the actual file upload in the form, use a "virtual" ``file`` field.
104111
For example, if you're building your form directly in a controller, it might

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.