public function save_profile_list_data() { #Goodbye, XSS if ($this->session->accept_token != REQUEST_TOKEN) { Request::redirect(HOST . 'login'); return; } PhxMemcache::delete('lists_' . $this->session->user->id); Phalanx::loadClasses('Lists'); switch ($this->post->method) { case 'remove_list': Lists::remove($this->session->user->id, $this->post->list_id); header("Content-type:text/html;charset=utf-8"); $o->status = true; die(json_encode($o)); break; case 'add_list': $data = new stdClass(); $data->name = $this->post->list_title; $data->social_networks = $this->post->new_list_social_networks; $data->categories = $this->post->new_list_categories; $list_id = Lists::add($this->session->user->id, $data); header("Content-type:text/html;charset=utf-8"); $o->status = (bool) $list_id; die(json_encode($o)); break; } }