Download the PHP package heimrichhannot/contao-filename-sanitizer-bundle without Composer

On this page you can find all versions of the php package heimrichhannot/contao-filename-sanitizer-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package contao-filename-sanitizer-bundle

Contao Filename Sanitizer Bundle

This bundle offers functionality for sanitizing filenames, i.e. replacing unwanted characters like whitespaces, non-ascii characters, ... (e.g. while uploading them to the CMS).

Features

Default sanitizing rules after installation of this bundle

Configuration in Contao's global settings

Installation

Install via composer: composer require heimrichhannot/contao-filename-sanitizer-bundle and update your database.

Configuration

You can configure the sanitizing rules in the global Contao settings under "file names".

Important notes

When is the sanitizing done exactly?

There are different situations where the filename sanitizing (which affects files and folders) takes place:

  1. A new file is uploaded by using Contao's file manager (files uploaded by FTP are of course not covered)
  2. An already existing file is saved by using Contao's file manager.
  3. An already existing folder is saved by using Contao's file manager. Files inside the folder are NOT sanitized automatically!
  4. By using the command huh_filename_sanitizer:sanitize. See below for more details.

What about already existing files and folders and the links to these?

IMPORTANT: The sanitizing rules are applied when saving a file or folder already existing.

The file or folder is linked in the system by binary UUID

This is the case if you have used fileTree widgets (file pickers) in news or content elements for example. Same applies if you have used inserttags like {{file::some-hash-uuid}}.

In this case the links will be working even after the sanitizing has been done because the link is done by an immutable binary UUID stored in the database.

The file or folder is linked in the system by a hardcoded path

Files and folders already present in the system

Caution: Files not linked by UUIDs are DEAD after filename sanitizing has been used.

You'll have to create htaccess rules to redirect the old paths to the new ones in this case.

The file or folder if linked from outside of the system

In this case it's of course always a hardcoded path. You'll have to create htaccess rules to redirect the old paths to the new ones in this case.

Commands

Sanitize Command

This command is designed for sanitizing existing files as a batch processing. Please use it with caution!

Features:

Usage:

Options:

Events

Name Arguments
AfterFilenameSanitizationEvent string $file
AfterFolderSanitizationEvent string $folder
AfterStringSanitizationEvent string $string
BeforeFilenameSanitizationEvent \Contao\File file
BeforeFolderSanitizationEvent \Contao\Folder $folder
BeforeStringSanitizationEvent string $string

All versions of contao-filename-sanitizer-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4||^8.0
contao/core-bundle Version ^4.9
heimrichhannot/contao-multi-column-editor-bundle Version ^2.13
symfony/config Version ^4.4||^5.0
symfony/console Version ^4.4||^5.0
symfony/event-dispatcher Version ^4.4||^5.0
symfony/http-kernel Version ^4.4||^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package heimrichhannot/contao-filename-sanitizer-bundle contains the following files

Loading the files please wait ....