From 8f5f1a42a909e628d7861457dacaebb9e8d727e8 Mon Sep 17 00:00:00 2001 From: middlebrain Date: Sat, 11 Aug 2018 17:36:18 +0200 Subject: [PATCH] Command shell:path:change (cd): Allow trailing slash on path The 'cd' command complains if the path ends with a slash. That's annoying. --- src/PHPCR/Shell/Phpcr/PhpcrSession.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/PHPCR/Shell/Phpcr/PhpcrSession.php b/src/PHPCR/Shell/Phpcr/PhpcrSession.php index 2b43eeb8..52262836 100644 --- a/src/PHPCR/Shell/Phpcr/PhpcrSession.php +++ b/src/PHPCR/Shell/Phpcr/PhpcrSession.php @@ -104,6 +104,10 @@ public function chdir($path) } } + if ($newPath !== '/') { + $newPath = rtrim($newPath, '/'); + } + // check that path is valid $this->getNode($newPath); }