Page MenuHomePhabricator

Loosen SVG file type check
ClosedPublic

Authored by Gilles on Feb 13 2018, 2:34 PM.

Details

Maniphest Tasks
T187088: Thumbor won't render some SVGs whose namespace is too far into the file
Reviewers
fgiunchedi
Commits
rTHMBREXT60a20131f22c: Loosen SVG file type check
Patch without arc
git checkout -b D975 && curl -L https://phabricator.wikimedia.org/D975?download=true | git apply
Summary

Implements a custom file loader mimicking the
excerpt mechanics found in others loaders used in
productiob, to make tests more realistic.

Which uncovered a previously unknown bug with the
out-of-bounds PDF fallback, fixed as part of this change.

Refs T187088

Diff Detail

Repository
rTHMBREXT Thumbor Plugins
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Gilles created this revision.Feb 13 2018, 2:34 PM
Gilles requested review of this revision.Feb 13 2018, 2:35 PM
fgiunchedi added inline comments.Feb 13 2018, 3:26 PM
wikimedia_thumbor/loader/file/__init__.py
11

2018

54

f here shadows f from the context manager, please use another name

Gilles updated this revision to Diff 2557.Feb 13 2018, 4:22 PM
Gilles marked 2 inline comments as done.

Fix copyright year and variable name

fgiunchedi accepted this revision.Feb 14 2018, 8:37 AM
This revision is now accepted and ready to land.Feb 14 2018, 8:37 AM
This revision was automatically updated to reflect the committed changes.