]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Twig/WallabagExtension.php
Changed RSS to Atom feed and improve paging
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Twig / WallabagExtension.php
index 00b1e595499d05f79de855e460a7a863af8a00a6..61107ce725437e218c784893f792bdac70516412 100644 (file)
@@ -28,6 +28,7 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa
     {
         return [
             new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']),
+            new \Twig_SimpleFilter('removeScheme', [$this, 'removeScheme']),
             new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']),
         ];
     }
@@ -46,11 +47,14 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa
         return preg_replace('/^www\./i', '', $url);
     }
 
+    public function removeScheme($url)
+    {
+        return preg_replace('#^https?://#i', '', $url);
+    }
+
     public function removeSchemeAndWww($url)
     {
-        return $this->removeWww(
-            preg_replace('@^https?://@i', '', $url)
-        );
+        return $this->removeWww($this->removeScheme($url)
     }
 
     /**