mirror of
https://github.com/gamaio/lobli.git
synced 2024-12-22 19:52:40 +00:00
Grab links from list and start redirecting again.
get links:id doesn't work since I moved it into a list. That break doesn't do anything, removing it.
This commit is contained in:
parent
41a6684ccc
commit
5d41d3adb8
@ -45,14 +45,13 @@
|
||||
}else{
|
||||
if($trTtl == -2){ // The link has been deleted, no need to track it anymore
|
||||
$redis->zRem("tracking:clicks", $link);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$short = $redis->get("links:$link");
|
||||
$short = $redis->lRange("links:$link", 0, 0);
|
||||
if($short){
|
||||
echo $short;
|
||||
header('location:'.$short[0]);
|
||||
exit(5);
|
||||
}
|
||||
}
|
||||
@ -68,15 +67,11 @@
|
||||
exit 13 - Shortener About redirection
|
||||
*/
|
||||
|
||||
// This has been depreciated. Still here for backwards compatibility with existing links
|
||||
if(!empty($_GET['l'])){
|
||||
followLink($redis, $_GET['l']);
|
||||
}
|
||||
|
||||
// New way to check for valid short links, two characters shorter than the if statement above
|
||||
if(!empty($_GET)){
|
||||
$key = key($_GET);
|
||||
|
||||
if($key == "l") $key = $_GET['l'];
|
||||
|
||||
if($key == "stats"){ header("location:http://s.lob.li"); exit(11); }
|
||||
if($key == "resolv"){ header("location:http://r.lob.li"); exit(12); }
|
||||
if($key == "about"){ header("location:http://a.lob.li"); exit(13); }
|
||||
|
Loading…
Reference in New Issue
Block a user