From 5d68d46ae2f24a2eb18ff8db27b07cfe7ea243c1 Mon Sep 17 00:00:00 2001 From: Matthieu Marcillaud Date: Tue, 15 Feb 2022 10:43:49 +0100 Subject: [PATCH] =?UTF-8?q?Trouver=20racine=20retoune=20""=20lorsque=20l?= =?UTF-8?q?=E2=80=99on=20transmet=20uniquement=20des=20fichiers=20sans=20r?= =?UTF-8?q?=C3=A9pertoire.=20Dans=20ce=20cas,=20=C3=A7a=20doit=20correspon?= =?UTF-8?q?dre=20au=20r=C3=A9pertoire=20courant.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/SpipArchiver.php | 2 +- tests/SpipArchiverTest.php | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/SpipArchiver.php b/src/SpipArchiver.php index ce60265..c70a413 100644 --- a/src/SpipArchiver.php +++ b/src/SpipArchiver.php @@ -73,7 +73,7 @@ class SpipArchiver extends AbstractArchiver implements ArchiverInterface * {@inheritDoc} */ public function emballer(array $chemins = [], ?string $racine = null, ?string $meta = null): bool { - $source = is_null($racine) ? $this->trouverRacine($chemins) : $racine; + $source = is_null($racine) ? ($this->trouverRacine($chemins) ?: '.') : $racine; if (!(is_dir($source) && is_readable($source))) { $this->setErreur(7); diff --git a/tests/SpipArchiverTest.php b/tests/SpipArchiverTest.php index 83e21b8..a12f925 100644 --- a/tests/SpipArchiverTest.php +++ b/tests/SpipArchiverTest.php @@ -418,5 +418,4 @@ class SpipArchiverTest extends TestCase $this->assertEquals($expectedInformer, $archiver->informer(), 'error informer ok'); } - }