Exemplo n.º 1
0
        default:
            $l = Link::from_db($id, null, false);
            if (!$l) {
                exit(0);
            }
            if (!$globals['mobile'] && !$globals['mobile_version'] && !empty($l->url) && $current_user->user_id > 0 && (empty($globals['https']) || preg_match('/^https:/', $l->url)) && User::get_pref($current_user->user_id, 'use_bar') && $db->get_var("select blog_type from blogs where blog_id = {$l->blog}") != 'noiframe') {
                $url = $globals['scheme'] . '//' . get_server_name() . $globals['base_url'] . 'b/' . $id;
                // we use always http to load no https pages
                do_redirection($url, 307);
            } else {
                if (empty($l->url)) {
                    $url = $l->get_permalink();
                } else {
                    $url = $l->url;
                }
                do_redirection($url);
            }
            $l->add_click();
            exit(0);
    }
} else {
    require mnminclude . $globals['html_main'];
    do_error(_('enlace inexistente'), 404);
}
function do_redirection($url, $code = 301)
{
    if (isset($_GET['quiet'])) {
        return;
        // Don't redirect if the caller asked so
    }
    redirect($url, $code);
Exemplo n.º 2
0
            do_redirection($url);
            exit(0);
        default:
            $l = Link::from_db($id, null, false);
            if (!$l) {
                exit(0);
            }
            if (!$globals['mobile'] && !$globals['mobile_version'] && $current_user->user_id > 0 && User::get_pref($current_user->user_id, 'use_bar') && $db->get_var("select blog_type from blogs where blog_id = {$l->blog}") != 'noiframe') {
                if ($globals['base_bar_url']) {
                    $url = $globals['base_url'] . $globals['base_bar_url'] . $id;
                } else {
                    $url = $globals['base_url'] . "bar.php?id={$id}";
                }
                do_redirection($url, 307);
            } else {
                do_redirection($l->url);
            }
            $l->add_click();
            exit(0);
    }
} else {
    require mnminclude . $globals['html_main'];
    do_error(_('enlace inexistente'), 404);
}
function do_redirection($url, $code = 301)
{
    if (isset($_GET['quiet'])) {
        return;
        // Don't redirect if the caller asked so
    }
    redirect($url, $code);