static function Authorize() { parse_str($_SERVER['QUERY_STRING'], $query); if (isset($query['state']) && strpos($query['state'], WPAL2Int::Authorize_secret()) !== false) { // Build new url $query['state'] = ''; $query['al2fb_action'] = 'authorize'; if (is_multisite()) { global $blog_id; $url = get_admin_url($blog_id, 'admin.php?page=' . str_replace('/add-link-to-facebook.php', '', plugin_basename(WPAL2Int::Get_main_file())), 'admin'); } else { $url = admin_url('admin.php?page=' . str_replace('/add-link-to-facebook.php', '', plugin_basename(WPAL2Int::Get_main_file()))); } $url .= '&' . http_build_query($query, '', '&'); // Debug info update_option(c_al2fb_log_redir_time, date('c')); update_option(c_al2fb_log_redir_ref, empty($_SERVER['HTTP_REFERER']) ? null : $_SERVER['HTTP_REFERER']); update_option(c_al2fb_log_redir_from, $_SERVER['REQUEST_URI']); update_option(c_al2fb_log_redir_to, $url); // Redirect wp_redirect($url); exit; } }