Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
check_file() is a tiny wrapper around PHP's is_uploaded_file().
function check_file($filename) {
return is_uploaded_file($filename);
}
According to api.drupal.org it has been around for since at least Drupal 4.6, but it has not been used anywhere in core in 4.6 or later.
The function name indicates that it returns an HTML-encoded string like check_plain(), check_markup() and check_url(), but it returns a boolean. Also, the name doesn't tell what kind of check is done. I think calling is_uploaded_file() directly is simpler and more readable, so I suggest removing the function.
Comment | File | Size | Author |
---|---|---|---|
check_file-1.patch | 954 bytes | c960657 | |
Comments
Comment #1
aspilicious CreditAttribution: aspilicious commentedIt's true, it's never used and this is the proove you need to put this rtbc :)
Nice catch c960657!
Comment #2
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.