From: Jeremy Benoist Date: Wed, 15 May 2019 12:38:07 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/master' into 2.4 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=9f0957b831622ee577fa7d8f92ec0df6f3a8e274;hp=9e2194e9cb55acf0a715e36c33f9f9d8689e0761;p=github%2Fwallabag%2Fwallabag.git Merge remote-tracking branch 'origin/master' into 2.4 --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 495bd1d8..e418d3e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## [2.3.8](https://github.com/wallabag/wallabag/tree/2.3.8) + [Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.7...2.3.8) + +### Fixes + +- Jump to 2.3.8-dev [#3897](https://github.com/wallabag/wallabag/pull/3897) +- material: fix left padding on non-entry pages [#3901](https://github.com/wallabag/wallabag/pull/3901) +- Make dev/install/update script posix compatible [#3860](https://github.com/wallabag/wallabag/pull/3860) +- epub: fix exception when articles have the same title [#3908](https://github.com/wallabag/wallabag/pull/3908) +- Fix PHP warning [#3909](https://github.com/wallabag/wallabag/pull/3909) +- Add ability to match many domains for credentials [#3937](https://github.com/wallabag/wallabag/pull/3937) +- material: add metadata to list view [#3942](https://github.com/wallabag/wallabag/pull/3942) +- Enable no-referrer on img tags, enable strict-origin-when-cross-origin by default [#3943](https://github.com/wallabag/wallabag/pull/3943) +- Remove preview picture from share view page#3922 +- Fix Intl Locale issue [#3964](https://github.com/wallabag/wallabag/pull/3964) + ## [2.3.7](https://github.com/wallabag/wallabag/tree/2.3.7) [Full Changelog](https://github.com/wallabag/wallabag/compare/2.3.6...2.3.7) diff --git a/app/Resources/static/themes/material/css/cards.scss b/app/Resources/static/themes/material/css/cards.scss index c893b376..9ae1be82 100644 --- a/app/Resources/static/themes/material/css/cards.scss +++ b/app/Resources/static/themes/material/css/cards.scss @@ -18,6 +18,24 @@ main { overflow: hidden; } +@mixin mixin-reading-time { + .reading-time { + display: inline-flex; + vertical-align: middle; + + .card-reading-time, + .card-created-at { + display: inline-flex; + } + + span { + margin-right: 5px; + } + + @content; + } +} + .card { .card-content .card-title, .card-reveal .card-title { @@ -98,19 +116,7 @@ main { margin-right: 5px !important; } - .reading-time { - display: inline-flex; - vertical-align: middle; - - .card-reading-time, - .card-created-at { - display: inline-flex; - } - - span { - margin-right: 5px; - } - } + @include mixin-reading-time; } .card-image { @@ -235,10 +241,18 @@ a.original:not(.waves-effect) { } div.metadata { + overflow: hidden; + height: 1.5em; + display: flex; + + ul.tags { + margin-left: 4px; + } + .chip { background-color: $blueAccentColor; padding: 0 7px; - margin: auto 2px; + margin: auto 1px; border-radius: 6px; line-height: 22px; height: 22px; @@ -255,6 +269,16 @@ a.original:not(.waves-effect) { padding-left: 8px; } } + + @include mixin-reading-time { + padding: 0 5px; + flex-wrap: wrap; + margin-left: auto; + + i.material-icons { + font-size: 20px; + } + } } div.card-content { diff --git a/app/Resources/static/themes/material/css/media_queries.scss b/app/Resources/static/themes/material/css/media_queries.scss index 491eedce..6f9d2a95 100644 --- a/app/Resources/static/themes/material/css/media_queries.scss +++ b/app/Resources/static/themes/material/css/media_queries.scss @@ -173,6 +173,10 @@ .row .col { padding: 0; } + + .card-stacked div.metadata .reading-time { + display: none; + } } @media screen and (max-width: 310px), diff --git a/app/config/wallabag.yml b/app/config/wallabag.yml index 96dfacf9..99088a6f 100644 --- a/app/config/wallabag.yml +++ b/app/config/wallabag.yml @@ -1,5 +1,5 @@ wallabag_core: - version: 2.3.8-dev + version: 2.3.8 paypal_url: "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=9UBA65LG3FX9Y&lc=gb" languages: en: 'English' diff --git a/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php index c73173e8..9a7d116f 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php @@ -5,20 +5,39 @@ namespace Wallabag\CoreBundle\DataFixtures; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Common\DataFixtures\DependentFixtureInterface; use Doctrine\Common\Persistence\ObjectManager; +use Symfony\Component\DependencyInjection\ContainerAwareInterface; +use Symfony\Component\DependencyInjection\ContainerInterface; use Wallabag\CoreBundle\Entity\SiteCredential; use Wallabag\UserBundle\DataFixtures\UserFixtures; -class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface +class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface, ContainerAwareInterface { + /** + * @var ContainerInterface + */ + private $container; + + public function setContainer(ContainerInterface $container = null) + { + $this->container = $container; + } + /** * {@inheritdoc} */ public function load(ObjectManager $manager) { $credential = new SiteCredential($this->getReference('admin-user')); - $credential->setHost('example.com'); - $credential->setUsername('foo'); - $credential->setPassword('bar'); + $credential->setHost('.super.com'); + $credential->setUsername($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('.super')); + $credential->setPassword($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('bar')); + + $manager->persist($credential); + + $credential = new SiteCredential($this->getReference('admin-user')); + $credential->setHost('paywall.example.com'); + $credential->setUsername($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('paywall.example')); + $credential->setPassword($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('bar')); $manager->persist($credential); diff --git a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php index 90e00c62..c7502bac 100644 --- a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php +++ b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php @@ -62,11 +62,24 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder $host = substr($host, 4); } - $credentials = null; - if ($this->currentUser) { - $credentials = $this->credentialRepository->findOneByHostAndUser($host, $this->currentUser->getId()); + if (!$this->currentUser) { + $this->logger->debug('Auth: no current user defined.'); + + return false; + } + + $hosts = [$host]; + // will try to see for a host without the first subdomain (fr.example.org & .example.org) + $split = explode('.', $host); + + if (\count($split) > 1) { + // remove first subdomain + array_shift($split); + $hosts[] = '.' . implode('.', $split); } + $credentials = $this->credentialRepository->findOneByHostsAndUser($hosts, $this->currentUser->getId()); + if (null === $credentials) { $this->logger->debug('Auth: no credentials available for host.', ['host' => $host]); diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 31953f12..bc257ffb 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -47,6 +47,7 @@ class ContentProxy */ public function updateEntry(Entry $entry, $url, array $content = [], $disableContentUpdate = false) { + $this->graby->toggleImgNoReferrer(true); if (!empty($content['html'])) { $content['html'] = $this->graby->cleanupHtml($content['html'], $url); } diff --git a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php index b2e212a4..aeadd770 100644 --- a/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php +++ b/src/Wallabag/CoreBundle/Repository/SiteCredentialRepository.php @@ -19,16 +19,16 @@ class SiteCredentialRepository extends \Doctrine\ORM\EntityRepository /** * Retrieve one username/password for the given host and userId. * - * @param string $host - * @param int $userId + * @param array $hosts An array of host to look for + * @param int $userId * * @return array|null */ - public function findOneByHostAndUser($host, $userId) + public function findOneByHostsAndUser($hosts, $userId) { $res = $this->createQueryBuilder('s') ->select('s.username', 's.password') - ->where('s.host = :hostname')->setParameter('hostname', $host) + ->where('s.host IN (:hosts)')->setParameter('hosts', $hosts) ->andWhere('s.user = :userId')->setParameter('userId', $userId) ->setMaxResults(1) ->getQuery() diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml index 61ef3b8f..e04c2ff1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml @@ -572,7 +572,7 @@ site_credential: # create_new_one: Create a new credential # form: # username_label: 'Username' - # host_label: 'Host' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' # password_label: 'Password' # save: Save # delete: Delete diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml index 991e00f1..5a9668a9 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml @@ -563,7 +563,7 @@ site_credential: create_new_one: 'Einen neuen Seitenzugang anlegen' form: username_label: 'Benutzername' - host_label: 'Host' + host_label: 'Host (subdomain.example.org, .example.org, etc.)' password_label: 'Passwort' save: 'Speichern' delete: 'Löschen' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml index 5b875652..e2994f53 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml @@ -572,7 +572,7 @@ site_credential: create_new_one: Create a new credential form: username_label: 'Username' - host_label: 'Host' + host_label: 'Host (subdomain.example.org, .example.org, etc.)' password_label: 'Password' save: Save delete: Delete diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml index 562b4191..d1ccfc81 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml @@ -572,7 +572,7 @@ site_credential: # create_new_one: Create a new credential # form: # username_label: 'Username' - # host_label: 'Host' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' # password_label: 'Password' # save: Save # delete: Delete diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml index f360e0d6..e5d36bd3 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml @@ -572,7 +572,7 @@ site_credential: # create_new_one: Create a new credential # form: # username_label: 'Username' - # host_label: 'Host' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' # password_label: 'Password' # save: Save # delete: Delete diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml index 79f15154..0b1853a4 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml @@ -573,7 +573,7 @@ site_credential: create_new_one: Créer un nouvel accès à un site form: username_label: 'Identifiant' - host_label: 'Domaine' + host_label: 'Domaine (subdomain.example.org, .example.org, etc.)' password_label: 'Mot de passe' save: "Sauvegarder" delete: "Supprimer" diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml index daef359f..0474d2bc 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml @@ -571,7 +571,7 @@ site_credential: # create_new_one: Create a new credential # form: # username_label: 'Username' - # host_label: 'Host' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' # password_label: 'Password' # save: Save # delete: Delete diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml index 980ddeb4..e761832e 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml @@ -571,7 +571,7 @@ site_credential: create_new_one: Crear un novèl identificant form: username_label: "Nom d'utilizaire" - host_label: 'Òste' + host_label: 'Òste (subdomain.example.org, .example.org, etc.)' password_label: 'Senhal' save: 'Enregistrar' delete: 'Suprimir' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml index 3813ac37..f3d506e5 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml @@ -571,7 +571,7 @@ site_credential: create_new_one: Stwórz nowe poświadczenie form: username_label: 'Nazwa użytkownika' - host_label: 'Host' + host_label: 'Host (subdomain.example.org, .example.org, etc.)' password_label: 'Hasło' save: Zapisz delete: Usuń diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml index 96943c05..6ddc1fc1 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml @@ -571,7 +571,7 @@ site_credential: # create_new_one: Create a new credential form: # username_label: 'Username' - # host_label: 'Host' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' # password_label: 'Password' save: 'Salvar' delete: 'Apagar' diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml index 0ce11e74..8c0791f0 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml @@ -571,7 +571,7 @@ site_credential: # create_new_one: Create a new credential # form: # username_label: 'Username' - # host_label: 'Host' + # host_label: 'Host (subdomain.example.org, .example.org, etc.)' # password_label: 'Password' # save: Save # delete: Delete diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml index e04eee68..967ae427 100644 --- a/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml +++ b/src/Wallabag/CoreBundle/Resources/translations/messages.th.yml @@ -569,7 +569,7 @@ site_credential: create_new_one: สร้างข้อมูลส่วนตัวใหม่ form: username_label: 'ชื่อผู้ใช้' - host_label: 'โฮส' + host_label: 'โฮส (subdomain.example.org, .example.org, etc.)' password_label: 'รหัสผ่าน' save: บันทึก delete: ลบ diff --git a/src/Wallabag/CoreBundle/Resources/views/base.html.twig b/src/Wallabag/CoreBundle/Resources/views/base.html.twig index aa388bcb..c0eecd57 100644 --- a/src/Wallabag/CoreBundle/Resources/views/base.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/base.html.twig @@ -8,6 +8,7 @@ {% block head %} + diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig index e1c7aad9..4294a60d 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Entry/share.html.twig @@ -29,9 +29,6 @@

{{ entry.title|e|raw }}

{{ entry.domainName|removeWww }}

{{ "entry.public.shared_by_wallabag"|trans({'%wallabag_instance%': url('homepage'), '%username%': entry.user.username})|raw }}.

- {% if entry.previewPicture is not null %} - {{ entry.title|striptags|e('html_attr') }} - {% endif %}
{{ entry.content | raw }} diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig index 1f3cd1a7..1102a0bd 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/Card/_content.html.twig @@ -8,8 +8,11 @@
{{ entry.domainName|removeWww }} - {% if withTags is defined %} + {% if withMetadata is defined %} {% include "@WallabagCore/themes/material/Entry/_tags.html.twig" with {'tags': entry.tags | slice(0, 3), 'entryId': entry.id, 'listClass': ' hide-on-med-and-down'} only %} +
+
{% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %}
+
{% endif %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig index 1c00f2fa..6a095035 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/_card_list.html.twig @@ -5,7 +5,7 @@ - {% include "@WallabagCore/themes/material/Entry/Card/_content.html.twig" with {'entry': entry, 'withTags': true, 'subClass': 'metadata'} only %} + {% include "@WallabagCore/themes/material/Entry/Card/_content.html.twig" with {'entry': entry, 'withMetadata': true, 'subClass': 'metadata'} only %}