summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/util.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/util.php b/lib/util.php
index c44d54fbf..666a715dd 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -842,8 +842,10 @@ function common_shorten_links($text) {
return $cache[$text] = preg_replace('@https?://[^)\]>\s]+@e', "common_shorten_link('\\0')", $text);
}
-function common_shorten_link($long_url) {
-
+function common_shorten_link($url, $reverse = false) {
+ static $url_cache = array();
+ if ($reverse) return isset($url_cache[$url]) ? $url_cache[$url] : $url;
+
$user = common_current_user();
$curlh = curl_init();