[ Index ] |
|
Code source de Serendipity 1.2 |
1 <?php # $Id: exit.php 1055 2006-04-06 09:14:11Z garvinhicking $ 2 # Copyright (c) 2003-2005, Jannis Hermanns (on behalf the Serendipity Developer Team) 3 # All rights reserved. See LICENSE file for licensing details 4 5 include 'serendipity_config.inc.php'; 6 7 $url = $serendipity['baseURL']; 8 9 if (isset($_GET['url_id']) && !empty($_GET['url_id']) && isset($_GET['entry_id']) && !empty($_GET['entry_id'])) { 10 11 // See if the submitted link is in our database and should be tracked 12 $links = serendipity_db_query("SELECT link FROM {$serendipity['dbPrefix']}references WHERE id = " . (int)$_GET['url_id'] . " AND entry_id = " . (int)$_GET['entry_id'], true); 13 14 if (is_array($links) && isset($links['link'])) { 15 // URL is valid. Track it. 16 $url = str_replace('&', '&', $links['link']); 17 serendipity_track_url('exits', $url, $_GET['entry_id']); 18 } elseif (isset($_GET['url']) && !empty($_GET['url'])) { 19 // URL is invalid. But a URL-location was sent, so we want to redirect the user kindly. 20 $url = str_replace('&', '&', base64_decode($_GET['url'])); 21 } 22 23 } elseif (isset($_GET['url']) && !empty($_GET['url'])) { 24 // No entry-link ID was submitted. Possibly a spammer tried to mis-use the script to get into the top-list. 25 $url = strip_tags(str_replace('&', '&', base64_decode($_GET['url']))); 26 } 27 28 if (serendipity_isResponseClean($url)) { 29 header('HTTP/1.0 301 Moved Permanently'); 30 header('Location: ' . $url); 31 } 32 exit; 33 /* vim: set sts=4 ts=4 expandtab : */ 34 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Nov 24 09:00:37 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |