Commit b24ca936 authored by Marco Boretto's avatar Marco Boretto Committed by GitHub

Merge pull request #242 from noplanman/fix_Message_getText

Correct the getText() method of the Message entity
parents e8400d66 e4a30b9c
...@@ -403,11 +403,12 @@ class Message extends Entity ...@@ -403,11 +403,12 @@ class Message extends Entity
public function getText($without_cmd = false) public function getText($without_cmd = false)
{ {
$text = $this->text; $text = $this->text;
if ($without_cmd) {
$command = $this->getFullCommand(); if ($without_cmd && $command = $this->getFullCommand()) {
if (!empty($command)) { if (strlen($command) + 1 < strlen($text)) {
//$text = substr($text, strlen($command.' '), strlen($text)); $text = substr($text, strlen($command) + 1);
$text = substr($text, strlen($command) + 1, strlen($text)); } else {
$text = '';
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment