ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
Utf8Mb4Sanitizer.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 use ilDBConstants;
28 
30 {
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.
A transformation is a function from one datatype to another.