From 8f188ffa8498424653a3e6086ef99bbe1745cd29 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 30 Apr 2020 12:11:51 +0200 Subject: Fix filenames for files exported with CLI (#2932) Filenames were created with the username of the current user. However, when we export the files with the CLI, the current user is "_". This commit makes the username always required in the `exportFile` method so we make sure to always manipulate a real value. Consequently, the filenames can be formatted correctly. Obviously, this has absolutely no impacts since the CLI doesn't consider the HTTP headers. It just makes things a bit more clear. It's a first step to remove the concept of "default user". --- cli/export-zip-for-user.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'cli/export-zip-for-user.php') diff --git a/cli/export-zip-for-user.php b/cli/export-zip-for-user.php index b89a55104..fcefa9ccf 100755 --- a/cli/export-zip-for-user.php +++ b/cli/export-zip-for-user.php @@ -20,10 +20,9 @@ fwrite(STDERR, 'FreshRSS exporting ZIP for user “' . $username . "”…\n"); $importController = new FreshRSS_importExport_Controller(); $ok = false; +$number_entries = empty($options['max-feed-entries']) ? 100 : intval($options['max-feed-entries']); try { - $ok = $importController->exportFile(true, true, true, true, - empty($options['max-feed-entries']) ? 100 : intval($options['max-feed-entries']), - $username); + $ok = $importController->exportFile($username, true, true, true, true, $number_entries); } catch (FreshRSS_ZipMissing_Exception $zme) { fail('FreshRSS error: Lacking php-zip extension!'); } -- cgit v1.2.3