mirror of
https://github.com/hotspotbilling/phpnuxbill.git
synced 2025-08-31 23:20:43 +02:00
User Inbox
This commit is contained in:
parent
150f9a5c41
commit
be507a013a
6 changed files with 130 additions and 69 deletions
|
@ -44,16 +44,17 @@ class Text
|
|||
return $result;
|
||||
}
|
||||
|
||||
public static function maskText($text){
|
||||
public static function maskText($text)
|
||||
{
|
||||
$len = strlen($text);
|
||||
if($len < 3){
|
||||
if ($len < 3) {
|
||||
return "***";
|
||||
}else if($len<5){
|
||||
return substr($text,0,1)."***".substr($text,-1,1);
|
||||
}else if($len<8){
|
||||
return substr($text,0,2)."***".substr($text,-2,2);
|
||||
}else{
|
||||
return substr($text,0,4)."******".substr($text,-3,3);
|
||||
} else if ($len < 5) {
|
||||
return substr($text, 0, 1) . "***" . substr($text, -1, 1);
|
||||
} else if ($len < 8) {
|
||||
return substr($text, 0, 2) . "***" . substr($text, -2, 2);
|
||||
} else {
|
||||
return substr($text, 0, 4) . "******" . substr($text, -3, 3);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,4 +62,9 @@ class Text
|
|||
{
|
||||
return preg_replace("/[^A-Za-z0-9]/", '_', $str);;
|
||||
}
|
||||
|
||||
public static function is_html($string)
|
||||
{
|
||||
return preg_match("/<[^<]+>/", $string, $m) != 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue