aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Twig/WallabagExtension.php')
-rw-r--r--src/Wallabag/CoreBundle/Twig/WallabagExtension.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Twig/WallabagExtension.php b/src/Wallabag/CoreBundle/Twig/WallabagExtension.php
index 351172c4..530e0492 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 ]; 32 ];
32 } 33 }
33 34
@@ -45,6 +46,11 @@ 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 removeScheme($url)
50 {
51 return preg_replace('#^https?://#', '', $url);
52 }
53
48 /** 54 /**
49 * Return number of entries depending of the type (unread, archive, starred or all). 55 * Return number of entries depending of the type (unread, archive, starred or all).
50 * 56 *