ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Utf8Mb4Sanitizer.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
28
30{
31 use DeriveApplyToFromTransform;
32 use DeriveInvokeFromTransform;
33
34 public function transform($from): string
35 {
36 if (!\is_string($from)) {
38 'Value to be transformed must be of type string',
39 'not_string'
40 );
41 }
42
43 return preg_replace(
44 '/[\x{10000}-\x{10FFFF}]/u',
46 $from
47 );
48 }
49}
transform($from)
Perform the transformation.
Class ilDBConstants.
A transformation is a function from one datatype to another.