diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2017-11-20 21:10:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-20 21:10:33 +0100 |
commit | f4f7994c40ca57c7e6f8ca0a3d298c50c4e5f813 (patch) | |
tree | 14b2c8f8ea61578a7ca0c5414a85ce29bcf57bd7 /src/Wallabag/CoreBundle/Twig | |
parent | 16b1939827453bc1c8f65c908c45575d27134a53 (diff) | |
parent | eae8138b33e4ed4a5d1a98daf77941ef691629de (diff) | |
download | wallabag-f4f7994c40ca57c7e6f8ca0a3d298c50c4e5f813.tar.gz wallabag-f4f7994c40ca57c7e6f8ca0a3d298c50c4e5f813.tar.zst wallabag-f4f7994c40ca57c7e6f8ca0a3d298c50c4e5f813.zip |
Merge pull request #3346 from Kdecherf/origin-property
Add originUrl property to Entry
Diffstat (limited to 'src/Wallabag/CoreBundle/Twig')
-rw-r--r-- | src/Wallabag/CoreBundle/Twig/WallabagExtension.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php index 351172c4..8992117e 100644 --- a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php +++ b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php | |||
@@ -28,6 +28,7 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa | |||
28 | { | 28 | { |
29 | return [ | 29 | return [ |
30 | new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), | 30 | new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), |
31 | new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']), | ||
31 | ]; | 32 | ]; |
32 | } | 33 | } |
33 | 34 | ||
@@ -45,6 +46,13 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa | |||
45 | return preg_replace('/^www\./i', '', $url); | 46 | return preg_replace('/^www\./i', '', $url); |
46 | } | 47 | } |
47 | 48 | ||
49 | public function removeSchemeAndWww($url) | ||
50 | { | ||
51 | return $this->removeWww( | ||
52 | preg_replace('@^https?://@i', '', $url) | ||
53 | ); | ||
54 | } | ||
55 | |||
48 | /** | 56 | /** |
49 | * Return number of entries depending of the type (unread, archive, starred or all). | 57 | * Return number of entries depending of the type (unread, archive, starred or all). |
50 | * | 58 | * |