From 58fce0e9390494c3c5c079e739220e9d42135d28 Mon Sep 17 00:00:00 2001 From: Michael Yoo Date: Sat, 19 Oct 2013 11:12:54 +1030 Subject: [PATCH] Fix /me @all critical server crash bug. Fix #840. Disabled usage of @all for non-ops. --- src/API/ConsoleAPI.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/API/ConsoleAPI.php b/src/API/ConsoleAPI.php index d6aaeb5e5..7d211daf3 100644 --- a/src/API/ConsoleAPI.php +++ b/src/API/ConsoleAPI.php @@ -204,9 +204,16 @@ class ConsoleAPI{ break; case "a": case "all": - $output = ""; - foreach($this->server->api->player->getAll() as $p){ - $output .= $this->run($cmd . " ". substr_replace($params, $p->username, $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1), $issuer, $alias); + if($this->server->api->ban->isOp($issuer->username)) + { + $output = ""; + foreach($this->server->api->player->getAll() as $p){ + $output .= $this->run($cmd . " ". substr_replace($params, $p->username, $selector[1] + $offsetshift - 1, strlen($selector[0]) + 1), $issuer, $alias); + } + } + else + { + $issuer->sendChat("You don't have permissions to use this command.\n"); } return $output; case "r":