src/StorageBucket.php
protected function isFilename($source): bool
    {
        if (!is_string($source)) {
            return false;
        }

        if (!preg_match('/[^A-Za-z0-9.#\\-$]/', $source)) {
            return false;
        }

        //To filter out binary strings
        $source = strval(str_replace("\0", "", $source));

        return file_exists($source);
    }
protected function isFilename($source): bool
    {
        if (!is_string($source)) {
            return false;
        }

        if (!preg_match('/[^A-Za-z0-9.#\\-$]/', $source)) {
            return false;
        }

        //To filter out binary strings
        $source = strval(str_replace("\0", "", $source));

        return file_exists($source);
    }
protected function isFilename ( $ source ) : bool { if ( ! is_string ( $ source ) ) { return false ; } if ( ! preg_match ( '/[^A-Za-z0-9.#\\-$]/' , $ source ) ) { return false ; } //To filter out binary strings $ source = strval ( str_replace ( "\0" , "" , $ source ) ) ; return file_exists ( $ source ) ; }
Check if given string is proper filename.

@param mixed $source

@return bool
Check if given string is proper filename .