}
        global $ks_commentdata;
        if (isset($ks_commentdata['message']) && $ks_commentdata['message']) {
            $comment_author = $ks_commentdata['author'];
            $comment_author_email = $ks_commentdata['email'];
            $comment_author_url = $ks_commentdata['url'];
            $comment_content = $ks_commentdata['content'];
            ?>
<p><font color="red">
			<?php 
            echo implode("<br />", array_map('esc_html', explode("\n", $ks_commentdata['message'])));
            ?>
			</font></p> 
		<?php 
        }
        ks_require_term_id_form(ks_plugin_url(KTAI_NOT_ECHO) . 'comments-post.php');
        ks_fix_encoding_form();
        if (is_user_logged_in()) {
            ks_session_id_form();
            ?>
			<p><?php 
            printf(__('Logged in as %s.', 'ktai_style'), esc_html($user_identity));
            ?>
 [<a href="<?php 
            echo esc_url(ks_get_logout_url(KTAI_NOT_ECHO, ks_comments_post_url()));
            ?>
"><?php 
            _e('Log out');
            ?>
</a>]<br /><?php 
            if (!ks_cookie_available()) {
 public function rewrite_link($url, $anchor, $attr)
 {
     if (preg_match($this->self_urls_regex, $url)) {
         $link_html = $this->link_element($this->base->strip_host($url), $anchor, $attr);
     } elseif (preg_match($this->leave_regex, $url) || preg_match($this->mobile_site_regex, $attr['class']) || $this->has_mobile_sites($url) || $this->base->ktai->is_search_engine()) {
         $link_html = NULL;
         // keep untouched
     } else {
         $colored_anchor = '<font color="' . ks_option('ks_external_link_color') . '">' . $anchor . '</font>';
         if (!$this->base->get('use_redir')) {
             $link_html = $this->link_element($url, $colored_anchor, $attr);
         } else {
             $icon = '<img localsrc="70" alt="' . __('[external]', 'ktai_style') . '" />';
             $nonce = $this->base->create_anon_nonce('redir_' . md5($url) . md5($_SERVER['HTTP_USER_AGENT']));
             if (preg_match($this->pconly_site_regex, $class) || $this->none_mobile_sites($url)) {
                 $pconly_html = '&amp;' . self::PCONLY_SITE_CLASS . '=true';
             } else {
                 $pconly_html = '';
             }
             $class = !empty($attr['class']) ? 'class="' . $attr['class'] . '"' : '';
             $style = !empty($attr['style']) ? 'style="' . $attr['style'] . '"' : '';
             $link_html = $icon . sprintf('<a href="%s%s/redir.php?_wpnonce=%s%s&amp;url=%s"%s%s>%s</a>', ks_plugin_url(KTAI_NOT_ECHO), KtaiStyle::INCLUDES_DIR, esc_attr($nonce), $pconly_html, rawurlencode($url), $class, $style, $colored_anchor);
         }
         $link_html = apply_filters('ktai_external_link', $link_html, $url, $anchor, $icon);
         $link_html = apply_filters('external_link/ktai_style.php', $link_html, $url, $anchor, $icon);
     }
     return $link_html;
 }
Ejemplo n.º 3
0
 public function bypass_admin_404()
 {
     global $Ktai_Style;
     // redirect to dashboard or login screen if accessed to non-existing URLs
     if (isset($Ktai_Style->admin)) {
         if (preg_match('!^' . ks_plugin_url(KTAI_NOT_ECHO) . KtaiStyle::ADMIN_DIR . '/!', $_SERVER['REQUEST_URI'])) {
             $sid = $Ktai_Style->admin->get_sid();
             if ($sid) {
                 $url = add_query_arg(KtaiStyle_Admin::SESSION_NAME, $sid, ks_admin_url(KTAI_NOT_ECHO));
             } else {
                 $url = ks_get_login_url();
             }
             wp_redirect($url);
             exit;
         }
     } elseif (preg_match('!wp-admin/!', $_SERVER['REQUEST_URI'])) {
         // cannot use is_admin()
         exit;
         // shut out access to non-existing admin screen
     }
 }
Ejemplo n.º 4
0
<html><head>
<meta http-equiv="Content-Type" content="<?php 
ks_mimetype();
?>
; charset=<?php 
ks_charset();
?>
" />
<meta name="robots" content="noindex,nofollow">
<title><?php 
echo ks_redir_has('full_url') ? __('Confirm connecting to external sites', 'ktai_style') : __('Error linking to external sites', 'ktai_style');
?>
</title>
</head><body>
<div><h1 id="logo"><img alt="WordPress" src="<?php 
echo ks_plugin_url(KTAI_NOT_ECHO) . KTAI_INCLUDES_DIR;
?>
/wplogo.gif" /></h1></div>
<?php 
if (ks_redir_has('full_url')) {
    if (!ks_redir_has('mobile_url')) {
        ?>
		<p><?php 
        _e('You are about to visit a website for PC:', 'ktai_style');
        ?>
<br />
		<font color="olive"><?php 
        echo htmlspecialchars(ks_redir_get('full_url'), ENT_QUOTES);
        ?>
</font>
	<?php 
function ks_get_logout_url($echo = false, $redirect = '')
{
    global $Ktai_Style;
    if (strlen($redirect)) {
        $redirect = '&redirect_to=' . urlencode($redirect);
    } else {
        $redirect = '';
    }
    if (isset($Ktai_Style->admin)) {
        if (!$Ktai_Style->get('cookie_available')) {
            $redirect = '&' . KtaiStyle_Admin::SESSION_NAME . '=' . KtaiStyle_Admin::get_sid() . $redirect;
        }
        $url = ks_plugin_url(KTAI_NOT_ECHO) . KtaiStyle::LOGIN_PAGE . '?action=logout' . $redirect;
        $url = wp_nonce_url($url, 'log-out');
    } else {
        $url = wp_logout_url($redirect);
    }
    if ($echo) {
        echo esc_attr($url);
    }
    return $url;
}