Skip to content
Snippets Groups Projects
  • Mike Pearce's avatar
    4f81cece
    Removed exceptions and error suppressions, replaced output buffering with file_get_contents() · 4f81cece
    Mike Pearce authored
    As we hide Exceptions from the end user, I've changed it to _doing_it_wrong(), so even if there is a problem, it'll be picked up in development.
    The errors were supporessed because if image data was passed as a string, the file_exists() and is_readable() don't pattern match, they look for a file. So complain they were passed a string and not a file path. The best way around this is to look for a supported file extension first.
    Output buffering seems overkill when you're only looking for the content of one file. So changed to file_get_contents()
    4f81cece
    History
    Removed exceptions and error suppressions, replaced output buffering with file_get_contents()
    Mike Pearce authored
    As we hide Exceptions from the end user, I've changed it to _doing_it_wrong(), so even if there is a problem, it'll be picked up in development.
    The errors were supporessed because if image data was passed as a string, the file_exists() and is_readable() don't pattern match, they look for a file. So complain they were passed a string and not a file path. The best way around this is to look for a supported file extension first.
    Output buffering seems overkill when you're only looking for the content of one file. So changed to file_get_contents()
Code owners
Assign users and groups as approvers for specific file changes. Learn more.