Skip to content
Myr

Merge pull request #1346 from ezyang/master

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Remove bad security advice about send_file, fixes #1345

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parents f0b4b99, 29f7c10 · Browse files · 1 file+2 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−6 removed

  • other:+2 added−6 removed

1 file+2 added−6 removed

modified:flask/helpers.py+2 added-6 removed
425 unmodified lines
426 to send certain files as attachment (HTML for instance). The mimetype427 guessing requires a `filename` or an `attachment_filename` to be428 provided.429430 Please never pass filenames to this function from user sources without431 checking them first. Something like this is usually sufficient to432 avoid security problems::430 Please never pass filenames to this function from user sources;431 you should use :func:`send_from_directory` instead.432434 if '..' in filename or filename.startswith('/'):435 abort(404)436433 .. versionadded:: 0.2434435 .. versionadded:: 0.5436 The `add_etags`, `cache_timeout` and `conditional` parameters were
463 unmodified lines