ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
HasSpecialChars.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use ILIAS\Data;
25
27{
28 private const ALLOWED_CHARS = '/[,_.\-#\+\*?!%ยง\‍(\‍)\$]/u';
29
30 public function __construct(Data\Factory $data_factory, \ILIAS\Language\Language $lng)
31 {
33 static function (Data\Password $value): bool {
34 return (bool) preg_match(self::ALLOWED_CHARS, $value->toString());
35 },
36 static function ($value): string {
37 return "Password must contain special chars.";
38 },
39 $data_factory,
40 $lng
41 );
42 }
43}
Builds data types.
Definition: Factory.php:36
A password is used as part of credentials for authentication.
Definition: Password.php:31
__construct(Data\Factory $data_factory, \ILIAS\Language\Language $lng)
A constraint encodes some resrtictions on values.
Definition: Constraint.php:32
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $lng
Definition: privfeed.php:31