<?php
-// Shaarli 0.5.0 - Shaare your links...
+// Shaarli 0.5.1 - Shaare your links...
// The personal, minimalist, super-fast, no-database Delicious clone. By sebsauvage.net
// http://sebsauvage.net/wiki/doku.php?id=php:shaarli
// Licence: http://www.opensource.org/licenses/zlib-license.php
$GLOBALS['config']['ENABLE_RSS_PERMALINKS'] = true; // Enable RSS permalinks by default. This corresponds to the default behavior of shaarli before this was added as an option.
$GLOBALS['config']['HIDE_PUBLIC_LINKS'] = false;
// -----------------------------------------------------------------------------------------------
-define('shaarli_version','0.5.0');
+define('shaarli_version','0.5.1');
// http://server.com/x/shaarli --> /shaarli/
define('WEB_PATH', substr($_SERVER["REQUEST_URI"], 0, 1+strrpos($_SERVER["REQUEST_URI"], '/', 0)));
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';
}
// -------- 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)