ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
HasSpecialChars.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 2018 Nils Haagen <nils.haagen@concepts-and-training.de> Extended GPL, see docs/LICENSE */
3 
5 
8 use ILIAS\Data;
9 
11 {
12  protected static $ALLOWED_CHARS = '/[,_.\-#\+\*?!%ยง\(\)\$]/';
13 
15  {
16  parent::__construct(
17  function (Data\Password $value) {
18  return (bool) preg_match(static::$ALLOWED_CHARS, $value->toString());
19  },
20  function ($value) {
21  return "Password must contain special chars.";
22  },
24  $lng
25  );
26  }
27 }
A constraint encodes some resrtictions on values.
Definition: Constraint.php:14
A password is used as part of credentials for authentication.
Definition: Password.php:13
Builds data types.
Definition: Factory.php:14
language handling
__construct(Data\Factory $data_factory, \ilLanguage $lng)