summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2008-12-02 23:17:30 -0500
committerEvan Prodromou <evan@controlyourself.ca>2008-12-02 23:17:30 -0500
commitf41e5317379ca86a28f48f1a1705fb916da36d44 (patch)
tree5a0bf590a4ec455b401615eff8287d410cda17c5 /lib
parent4b586436c8f9baf59b9bdffcdb259f50879f8c7d (diff)
fix conflict with Robin's changes on trunk
darcs-hash:20081203041730-5ed1f-1e1910cec75546291b14386d91f3bd22ae06b750.gz
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();