From: nodiscc Date: Wed, 3 Jun 2015 13:54:30 +0000 (+0200) Subject: split annoyingpatterns list on multpile lines, add new patterns for removal: X-Git-Tag: v0.5.0~41 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;ds=sidebyside;h=cbecab773526b0c39f3cffa1d4595b5caa781bda;p=github%2Fshaarli%2FShaarli.git split annoyingpatterns list on multpile lines, add new patterns for removal: * utm_content= * fb= * xtor= closes https://github.com/shaarli/Shaarli/issues/136 --- diff --git a/index.php b/index.php index a547fbe8..9561f63b 100644 --- a/index.php +++ b/index.php @@ -1664,7 +1664,20 @@ function renderPage() // We remove the annoying parameters added by FeedBurner, GoogleFeedProxy, Facebook... - $annoyingpatterns = array('/[\?&]utm_source=[^&]*/', '/[\?&]utm_campaign=[^&]*/', '/[\?&]utm_medium=[^&]*/', '/#xtor=RSS-[^&]*/', '/[\?&]fb_[^&]*/', '/[\?&]__scoop[^&]*/', '/#tk\.rss_all\?/', '/[\?&]action_ref_map=[^&]*/', '/[\?&]action_type_map=[^&]*/', '/[\?&]action_object_map=[^&]*/'); + $annoyingpatterns = array('/[\?&]utm_source=[^&]*/', + '/[\?&]utm_campaign=[^&]*/', + '/[\?&]utm_medium=[^&]*/', + '/#xtor=RSS-[^&]*/', + '/[\?&]fb_[^&]*/', + '/[\?&]__scoop[^&]*/', + '/#tk\.rss_all\?/', + '/[\?&]action_ref_map=[^&]*/', + '/[\?&]action_type_map=[^&]*/', + '/[\?&]action_object_map=[^&]*/', + '/[\?&]utm_content=[^&]*/', + '/[\?&]fb=[^&]*/', + '/[\?&]xtor=[^&]*/' + ); foreach($annoyingpatterns as $pattern) { $url = preg_replace($pattern, "", $url);