From 427ebf22700f13bf1edf030ee454582a89b4141c Mon Sep 17 00:00:00 2001 From: PEMapModder Date: Wed, 6 Aug 2014 12:24:56 +0800 Subject: [PATCH] Update TempBan.php --- src/EssentialsPE/Commands/TempBan.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EssentialsPE/Commands/TempBan.php b/src/EssentialsPE/Commands/TempBan.php index cf99caf4..56e0a85f 100644 --- a/src/EssentialsPE/Commands/TempBan.php +++ b/src/EssentialsPE/Commands/TempBan.php @@ -27,8 +27,8 @@ public function execute(CommandSender $sender, $alias, array $args){ return false; } $seconds = 0; - while(preg_match('#^(\d+(\.\d+)?)(y|mo|w|d|h|m|s)$#i', array_shift($args), $match, PREG_SET_ORDER)){ - $match = $match[0]; // TODO check if the flag is wrong + while(preg_match_all('#^(\d+(\.\d+)?)(y|mo|w|d|h|m|s)$#', array_shift($args), $match, PREG_SET_ORDER)){ + $match = $match[0]; // it won't get two matches anyways, or we will just ignore it (like 2w3s will only be parsed as 2 "w"eeks) if(!is_numeric($match[1])){ break; }