1
0
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:
Tim Düsterhus 2011-12-26 16:05:29 +01:00
commit c83336c9fb

View File

@ -120,7 +120,10 @@ public static function str_split($string, $length = 1) {
* @return integer * @return integer
*/ */
public static function timeModifier($time) { 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; $result = 0;
foreach ($matches[1] as $time) { foreach ($matches[1] as $time) {
// 60 seconds a minute // 60 seconds a minute