Skip to content
This repository has been archived by the owner on May 30, 2018. It is now read-only.

Commit

Permalink
Update TempBan.php
Browse files Browse the repository at this point in the history
  • Loading branch information
PEMapModder committed Aug 6, 2014
1 parent a5ac814 commit 427ebf2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/EssentialsPE/Commands/TempBan.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

4 comments on commit 427ebf2

@iksaku
Copy link

@iksaku iksaku commented on 427ebf2 Aug 6, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I don't use preg_match() xD

@PEMapModder
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't even understand how the _all (global search) makes a difference. Anyone can answer me?

@alejzeis
Copy link

@alejzeis alejzeis commented on 427ebf2 Aug 7, 2014 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PEMapModder
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting point. (IRC?)

Please sign in to comment.