Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-04-17 16:07:52 +0300
committerJoas Schilling <coding@schilljs.com>2020-04-17 16:18:48 +0300
commit296596ca32ec320ecee108311aa9c1d814991127 (patch)
tree46f30884309a4bfe976d83ae9895fbac76775bed /lib
parent03559d1c5ca87587591527b3e66abf6a197fd3d3 (diff)
Throw instead of showing the help
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Chat/Command/ShellExecutor.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Chat/Command/ShellExecutor.php b/lib/Chat/Command/ShellExecutor.php
index 4e54cd344..40515c708 100644
--- a/lib/Chat/Command/ShellExecutor.php
+++ b/lib/Chat/Command/ShellExecutor.php
@@ -41,16 +41,18 @@ class ShellExecutor {
* @throws \InvalidArgumentException
*/
public function execShell(string $cmd, string $arguments, string $room = '', string $user = ''): string {
+ if (strpos($cmd, self::PLACEHOLDER_ARGUMENTS_DOUBLEQUOTE_ESCAPED) !== false) {
+ throw new \InvalidArgumentException('Talk commands using the {ARGUMENTS_DOUBLEQUOTE_ESCAPED} are not supported anymore.');
+ }
+
$cmd = str_replace([
self::PLACEHOLDER_ROOM,
self::PLACEHOLDER_USER,
self::PLACEHOLDER_ARGUMENTS,
- self::PLACEHOLDER_ARGUMENTS_DOUBLEQUOTE_ESCAPED,
], [
escapeshellarg($room),
escapeshellarg($user),
escapeshellarg($arguments),
- '--help',
], $cmd);
return $this->wrapExec($cmd);