X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FTwig%2FWallabagExtension.php;h=8992117e62baef07228a517238ca44aa06ddf2e6;hb=1d91f14516e109978f497e9f55d2f87c8268e1d7;hp=351172c460f2fc24ba76c37e85e76b14ac958c57;hpb=1953a872932a63792293b4aec087880265ba89f7;p=github%2Fwallabag%2Fwallabag.git 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 { return [ new \Twig_SimpleFilter('removeWww', [$this, 'removeWww']), + new \Twig_SimpleFilter('removeSchemeAndWww', [$this, 'removeSchemeAndWww']), ]; } @@ -45,6 +46,13 @@ class WallabagExtension extends \Twig_Extension implements \Twig_Extension_Globa return preg_replace('/^www\./i', '', $url); } + public function removeSchemeAndWww($url) + { + return $this->removeWww( + preg_replace('@^https?://@i', '', $url) + ); + } + /** * Return number of entries depending of the type (unread, archive, starred or all). *