This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| files: | |
| "/etc/ImageMagick/policy.xml": | |
| mode: "000777" | |
| owner: ec2-user | |
| group: ec2-user | |
| content: | | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE policymap [ | |
| <!ELEMENT policymap (policy)+> | |
| <!ELEMENT policy (#PCDATA)> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <policymap> | |
| <policy domain="coder" rights="none" pattern="EPHEMERAL" /> | |
| <policy domain="coder" rights="none" pattern="HTTPS" /> | |
| <policy domain="coder" rights="none" pattern="MSL" /> | |
| <policy domain="coder" rights="none" pattern="MVG" /> | |
| <policy domain="coder" rights="none" pattern="PLT" /> | |
| <policy domain="coder" rights="none" pattern="SHOW" /> | |
| <policy domain="coder" rights="none" pattern="TEXT" /> | |
| <policy domain="coder" rights="none" pattern="URL" /> | |
| <policy domain="coder" rights="none" pattern="WIN" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| VALID_IMAGE_SIGNATURES = [ | |
| "\x89PNG\r\n\x1A\n".force_encoding(Encoding::ASCII_8BIT), # PNG | |
| "GIF87a".force_encoding(Encoding::ASCII_8BIT), # GIF87 | |
| "GIF89a".force_encoding(Encoding::ASCII_8BIT), # GIF89 | |
| "\xFF\xD8".force_encoding(Encoding::ASCII_8BIT) # JPEG | |
| ].freeze | |
| def file_is_image(temporary_file_path) | |
| return false unless temporary_file_path |