X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=index.php;h=74f95497ef39883de67a0d500e3156ccf34210dc;hb=d9d776af19fd0a191f82525991dafbb56e1bcfcb;hp=84b8f015ad1ae693ec36f3fbc24112628adf5796;hpb=a3b1b4ae709bd3c5a8ec6fe29aa36fd01c52bca5;p=github%2Fshaarli%2FShaarli.git diff --git a/index.php b/index.php index 84b8f015..74f95497 100755 --- a/index.php +++ b/index.php @@ -74,6 +74,7 @@ require_once 'application/Cache.php'; require_once 'application/CachedPage.php'; require_once 'application/LinkDB.php'; require_once 'application/TimeZone.php'; +require_once 'application/Url.php'; require_once 'application/Utils.php'; require_once 'application/Config.php'; @@ -1479,29 +1480,9 @@ function renderPage() } // -------- User want to post a new link: Display link edit form. - if (isset($_GET['post'])) - { - $url=$_GET['post']; - - // 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=[^&]*/', - '/[\?&]utm_content=[^&]*/', - '/[\?&]fb=[^&]*/', - '/[\?&]xtor=[^&]*/' - ); - foreach($annoyingpatterns as $pattern) - { - $url = preg_replace($pattern, "", $url); - } + if (isset($_GET['post'])) { + $url = new Url($_GET['post']); + $url->cleanup(); $link_is_new = false; $link = $LINKSDB->getLinkFromUrl($url); // Check if URL is not already in database (in this case, we will edit the existing link)