Compare commits
3 Commits
v9.29.0
...
c772a39156
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c772a39156 | ||
|
|
7907d1d507 | ||
|
|
01c4a35026 |
@@ -276,7 +276,7 @@ class Basic
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set the regex for checking emails
|
// set the regex for checking emails
|
||||||
$this->email_regex = "^[A-Za-z0-9!#$%&'*+-\/=?^_`{|}~][A-Za-z0-9!#$%:\(\)&'*+-\/=?^_`{|}~\.]{0,63}@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*\.([a-zA-Z]{2,}){1}$";
|
$this->email_regex = "^[A-Za-z0-9!#$%&'*+\-\/=?^_`{|}~][A-Za-z0-9!#$%:\(\)&'*+\-\/=?^_`{|}~\.]{0,63}@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*\.([a-zA-Z]{2,}){1}$";
|
||||||
// this is for error check parts in where the email regex failed
|
// this is for error check parts in where the email regex failed
|
||||||
$this->email_regex_check = array (
|
$this->email_regex_check = array (
|
||||||
1 => "@(.*)@(.*)", // double @
|
1 => "@(.*)@(.*)", // double @
|
||||||
@@ -1374,7 +1374,10 @@ class Basic
|
|||||||
if (!$hour || !$min) {
|
if (!$hour || !$min) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (($hour < 0 && $hour > 24) || ($min < 0 && $hour > 60) || ($sec && $sec < 0 && $sec > 60)) {
|
if (($hour < 0 || $hour > 24) ||
|
||||||
|
($min < 0 || $min > 60) ||
|
||||||
|
($sec && ($sec < 0 || $sec > 60))
|
||||||
|
) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -1446,6 +1449,40 @@ class Basic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// METHOD: calcDaysInterval
|
||||||
|
// PARAMS: start date, end date
|
||||||
|
// RETURN: overall days, week days, weekend days as array 0...2 or named
|
||||||
|
// DESC : calculates the days between two dates
|
||||||
|
private function calcDaysInterval($start_date, $end_date, $return_named = false)
|
||||||
|
{
|
||||||
|
// pos 0 all, pos 1 weekday, pos 2 weekend
|
||||||
|
$days = array ();
|
||||||
|
$start = new \DateTime($start_date);
|
||||||
|
$end = new \DateTime($end_date);
|
||||||
|
|
||||||
|
$days[0] = $end->diff($start)->days;
|
||||||
|
|
||||||
|
$period = new \DatePeriod($start, new \DateInterval('P1D'), $end);
|
||||||
|
|
||||||
|
foreach ($period as $dt) {
|
||||||
|
$curr = $dt->format('D');
|
||||||
|
if ($curr == 'Sat' || $curr == 'Sun') {
|
||||||
|
$days[2] ++;
|
||||||
|
} else {
|
||||||
|
$days[1] ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($return_named === true) {
|
||||||
|
return array (
|
||||||
|
'overall' => $days[0],
|
||||||
|
'weekday' => $days[1],
|
||||||
|
'weekend' => $days[2]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return $days;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// METHOD: createThumbnail
|
// METHOD: createThumbnail
|
||||||
// WAS : CreateThumbnail
|
// WAS : CreateThumbnail
|
||||||
// PARAMS: pic -> picture where from we create a thumbnail
|
// PARAMS: pic -> picture where from we create a thumbnail
|
||||||
|
|||||||
Reference in New Issue
Block a user