From 2c870423c486abdba3c00b7d854b8adc5ed40f50 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 2 Mar 2022 20:36:02 +0100 Subject: [PATCH] Fix epub language Ensure language has `_` instead of `-` And update wallabag/phpepub --- composer.json | 2 +- composer.lock | 14 +++++++------- src/Wallabag/CoreBundle/Helper/EntriesExport.php | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/composer.json b/composer.json index 36ae0bc2d..af1702b41 100644 --- a/composer.json +++ b/composer.json @@ -95,7 +95,7 @@ "tecnickcom/tcpdf": "^6.3.0", "twig/extensions": "^1.5", "wallabag/php-mobi": "~1.0", - "wallabag/phpepub": "^4.0.7.2", + "wallabag/phpepub": "^4.0.10", "willdurand/hateoas-bundle": "~2.1" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 910f88564..9243b4047 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7b402fa1eb644c821ddc5ed4097caafa", + "content-hash": "2a0e9af279e198c254d9a8e8b53044f0", "packages": [ { "name": "babdev/pagerfanta-bundle", @@ -11364,16 +11364,16 @@ }, { "name": "wallabag/phpepub", - "version": "4.0.9", + "version": "4.0.10", "source": { "type": "git", "url": "https://github.com/wallabag/PHPePub.git", - "reference": "cf94d02dce43b470752ef9e6dd0a1c8484af1f8f" + "reference": "1f74a5c113ffbea199cfca34e6521a08e6f67445" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wallabag/PHPePub/zipball/cf94d02dce43b470752ef9e6dd0a1c8484af1f8f", - "reference": "cf94d02dce43b470752ef9e6dd0a1c8484af1f8f", + "url": "https://api.github.com/repos/wallabag/PHPePub/zipball/1f74a5c113ffbea199cfca34e6521a08e6f67445", + "reference": "1f74a5c113ffbea199cfca34e6521a08e6f67445", "shasum": "" }, "require": { @@ -11428,9 +11428,9 @@ ], "support": { "issues": "https://github.com/wallabag/PHPePub/issues", - "source": "https://github.com/wallabag/PHPePub/tree/4.0.9" + "source": "https://github.com/wallabag/PHPePub/tree/4.0.10" }, - "time": "2021-03-08T08:31:34+00:00" + "time": "2022-03-21T19:27:18+00:00" }, { "name": "willdurand/hateoas", diff --git a/src/Wallabag/CoreBundle/Helper/EntriesExport.php b/src/Wallabag/CoreBundle/Helper/EntriesExport.php index 54304fc50..3b03514bc 100644 --- a/src/Wallabag/CoreBundle/Helper/EntriesExport.php +++ b/src/Wallabag/CoreBundle/Helper/EntriesExport.php @@ -161,8 +161,8 @@ class EntriesExport */ $book->setTitle($this->title); - // Not needed, but included for the example, Language is mandatory, but EPub defaults to "en". Use RFC3066 Language codes, such as "en", "da", "fr" etc. - $book->setLanguage($this->language); + // EPub specification requires BCP47-compliant languages, thus we replace _ with - + $book->setLanguage(str_replace('_', '-', $this->language)); $book->setDescription('Some articles saved on my wallabag'); $book->setAuthor($this->author, $this->author);