mirror of
https://github.com/wbbaddons/Tims-Chat.git
synced 2024-10-31 14:10:08 +00:00
Merge branch 'master' into chatTplRedesign
This commit is contained in:
commit
c83336c9fb
@ -120,7 +120,10 @@ public static function str_split($string, $length = 1) {
|
||||
* @return integer
|
||||
*/
|
||||
public static function timeModifier($time) {
|
||||
preg_match_all('!([0-9]+[s|h|d|w|m|y]?)!i', $time, $matches);
|
||||
$regex = new \wcf\system\Regex('([0-9]+[s|h|d|w|m|y]?)', \wcf\system\Regex::CASE_INSENSITIVE);
|
||||
if (!$regex->match($time, true)) return 0;
|
||||
$matches = $regex->getMatches();
|
||||
|
||||
$result = 0;
|
||||
foreach ($matches[1] as $time) {
|
||||
// 60 seconds a minute
|
||||
|
Loading…
Reference in New Issue
Block a user