mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
add common validation/filter library for text input fields
This commit is contained in:
parent
9407403d5d
commit
62679eb67f
3 changed files with 126 additions and 41 deletions
48
src/library/filter.php
Normal file
48
src/library/filter.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
class Filter
|
||||
{
|
||||
public static function magnetTitle(mixed $value) : string
|
||||
{
|
||||
$value = trim(
|
||||
strip_tags(
|
||||
html_entity_decode($value)
|
||||
)
|
||||
);
|
||||
|
||||
return (string) $value;
|
||||
}
|
||||
|
||||
public static function magnetPreview(mixed $value) : string
|
||||
{
|
||||
$value = trim(
|
||||
strip_tags(
|
||||
html_entity_decode($value)
|
||||
)
|
||||
);
|
||||
|
||||
return (string) $value;
|
||||
}
|
||||
|
||||
public static function magnetDescription(mixed $value) : string
|
||||
{
|
||||
$value = trim(
|
||||
strip_tags(
|
||||
html_entity_decode($value)
|
||||
)
|
||||
);
|
||||
|
||||
return (string) $value;
|
||||
}
|
||||
|
||||
public static function magnetDn(mixed $value) : string
|
||||
{
|
||||
$value = trim(
|
||||
strip_tags(
|
||||
html_entity_decode($value)
|
||||
)
|
||||
);
|
||||
|
||||
return (string) $value;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue