File: bootstrap.php

Recommend this page to a friend!
  Classes of Lars Moelleken  >  Portable UTF-8  >  bootstrap.php  >  Download  
File: bootstrap.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Portable UTF-8
Manipulate UTF-8 text strings in pure PHP
Author: By
Last change: [!!!]: disable "Bootup::filterRequestUri()" && "Bootup::filterRequestInputs()" by default

Since version 5.4.26 this library will NOT force "UTF-8" by "bootstrap.php" anymore.
If you need to enable this behavior you can define "PORTABLE_UTF8__ENABLE_AUTO_FILTER", before requiring the autoloader.

```php
define('PORTABLE_UTF8__ENABLE_AUTO_FILTER', 1);
```

Before version 5.4.26 this behavior was enabled by default and you could disable it via "PORTABLE_UTF8__DISABLE_AUTO_FILTER", but the code had potential security vulnerabilities via injecting code while redirecting via ```header('Location ...```.
This is the reason I decided to add this BC in a bug fix release, so that everybody using the current version will receive the security-fix.
Date: 8 months ago
Size: 386 bytes
 

Contents

Class file image Download
<?php

use voku\helper\Bootup;
use
voku\helper\UTF8;

Bootup::initAll(); // Enables UTF-8 for PHP
UTF8::checkForSupport(); // Check UTF-8 support for PHP

if (defined('PORTABLE_UTF8__ENABLE_AUTO_FILTER') === true) {
 
Bootup::filterRequestUri(); // Redirects to an UTF-8 encoded URL if it's not already the case
 
Bootup::filterRequestInputs(); // Normalizes HTTP inputs to UTF-8 NFC
}


For more information send a message to info at phpclasses dot org.