aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2017-06-13 18:48:10 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2019-04-25 13:46:31 +0200
commit531c8d0a5c55fa93438e227a7d349235fbd31d28 (patch)
treede2ff4a1e09161a5bbec32170471190e836d3bbc /src/Wallabag/CoreBundle/Twig/WallabagExtension.php
parent522e37ad274361dde697da13a92ff3f846599822 (diff)
downloadwallabag-531c8d0a5c55fa93438e227a7d349235fbd31d28.tar.gz
wallabag-531c8d0a5c55fa93438e227a7d349235fbd31d28.tar.zst
wallabag-531c8d0a5c55fa93438e227a7d349235fbd31d28.zip
Changed RSS to Atom feed and improve paging
Diffstat (limited to 'src/Wallabag/CoreBundle/Twig/WallabagExtension.php')
-rw-r--r--src/Wallabag/CoreBundle/Twig/WallabagExtension.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
index 00b1e595..61107ce7 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('removeScheme', [$this, 'removeScheme']),
31 new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']), 32 new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']),
32 ]; 33 ];
33 } 34 }
@@ -46,11 +47,14 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa
46 return preg_replace('/^www\./i', '', $url); 47 return preg_replace('/^www\./i', '', $url);
47 } 48 }
48 49
50 public function removeScheme($url)
51 {
52 return preg_replace('#^https?://#i', '', $url);
53 }
54
49 public function removeSchemeAndWww($url) 55 public function removeSchemeAndWww($url)
50 { 56 {
51 return $this->removeWww( 57 return $this->removeWww($this->removeScheme($url)
52 preg_replace('@^https?://@i', '', $url)
53 );
54 } 58 }
55 59
56 /** 60 /**