Correctly redirects from old style links using system settingsand not via hardcoded strings

This commit is contained in:
real_nowhereman 2008-01-15 15:13:41 +00:00
parent bee0261315
commit c4f437a47b
4 changed files with 34 additions and 41 deletions

View File

@ -4,7 +4,13 @@
require_once 'defaults.php';
require_once (INCLUDES_DIR.'includes.php');
@utils_status_header(301);
@utils_redirect('?'.$_SERVER['QUERY_STRING']);
/* backward compatibility */
if (!@$_GET['entry']) {
@utils_redirect('?'.$_SERVER['QUERY_STRING']);
} else {
@utils_status_header(301);
@utils_redirect(str_replace('&','&', get_permalink($_GET['entry'])), true);
}
?>

View File

@ -3,8 +3,17 @@
if (!defined('MOD_INDEX')) {
include 'defaults.php';
include INCLUDES_DIR . 'includes.php';
@utils_status_header(301);
@utils_redirect("?entry={$_GET['page']}&comments");
/* backward compatibility */
if (!@$_GET['entry']) {
@utils_redirect();
} else {
@utils_status_header(301);
@utils_redirect(str_replace('&','&', get_comments_link($_GET['entry'])), true);
}
}
$module = comment_main($module);

39
rss.php
View File

@ -4,40 +4,9 @@
require_once 'defaults.php';
require_once (INCLUDES_DIR.'includes.php');
// this is only for index
if (!file_exists(LOCKFILE)) {
utils_redirect('setup.php');
}
class LayoutRSSFeed extends Abstract_LayoutIndex {
function LayoutRSSFeed() {
/*
RSS feeds use new theme constracts,
which are now deprecated and that will
be unsupported from Crescendo+1 on
so let me use this hackish trick
to force legacy mode off :P
*/
define('THEME_LEGACY_MODE', false);
parent::Abstract_LayoutIndex();
$this->tpl = SHARED_TPLS . 'rss.tpl';
}
function main() {
header('Content-type: application/xml;');
$this->fpdb->query('fullparse:true');
}
}
$FLATPRESS =& new LayoutRSSFeed;
$FLATPRESS->display();
/* backward compatibility */
@utils_status_header(301);
@utils_redirect('?'. str_replace('&','&', theme_feed_link()) . '&' . $_SERVER['QUERY_STRING']);
?>

View File

@ -2,6 +2,15 @@
include 'defaults.php';
include INCLUDES_DIR . 'includes.php';
@utils_status_header(301);
@utils_redirect("?page={$_GET['page']}");
/* backward compatibility */
if (!@$_GET['page']) {
@utils_redirect();
} else {
@utils_status_header(301);
@utils_redirect(str_replace('&','&', theme_staticlink($_GET['page'])), true);
}
?>