mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
adding missing file
This commit is contained in:
parent
5d3be5dd24
commit
884c37c399
35
src/Model/Validation/GenericValidation.php
Normal file
35
src/Model/Validation/GenericValidation.php
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* To change this license header, choose License Headers in Project Properties.
|
||||||
|
* To change this template file, choose Tools | Templates
|
||||||
|
* and open the template in the editor.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Model\Validation;
|
||||||
|
|
||||||
|
class GenericValidation
|
||||||
|
{
|
||||||
|
public static function hexKey64($value, array $context) {
|
||||||
|
if(strlen($value) != 64) return false;
|
||||||
|
if(preg_match('/^[[:xdigit:]]*$/', $value)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function alphaNumeric($value, array $context) {
|
||||||
|
//if(preg_match('/^[a-zA-Z0-9äöüÄÖÜß _;:()-]\n\r*$/', $value)) {
|
||||||
|
if(preg_match('/([<>]|>|<|javascript:){1,}/', $value)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function email($value, array $context) {
|
||||||
|
if(preg_match('/^[a-zA-Z0-9.!#$%&’*+\/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/', $value)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user