Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PostFactory::is_image incorrectly using wp_check_filetype #2730

Merged
merged 1 commit into from
May 26, 2023

Commits on Apr 25, 2023

  1. Fix PostFactory::is_image incorrectly using wp_check_filetype

    The current way to detect an image is to use `wp_attachment_is_image` and use that with `wp_check_filetype` to detect if the file has an expected extension.
    
    However, `wp_check_filetype` is not meant to be used with an URL but with a path instead. So this check fails currently if the URL has query params for example.
    
    The fix is to use `get_attached_file` to get the actual file path instead of the URL matching what `wp_attachment_is_image` is doing.
    stayallive committed Apr 25, 2023
    Configuration menu
    Copy the full SHA
    c208e8b View commit details
    Browse the repository at this point in the history