ElggFileCache::sanitizeFilename PHP Méthode

sanitizeFilename() protected méthode

Create a sanitised filename for the file.
protected sanitizeFilename ( string $key ) : string
$key string The filename
Résultat string
    protected function sanitizeFilename($key)
    {
        // handles all keys in use by core
        if (preg_match('~^[a-zA-Z0-9\\-_\\.]{1,250}$~', $key)) {
            return $key;
        }
        $key = md5($key);
        // prevent collision with un-hashed keys
        $key = "=" . $key;
        return $key;
    }