/**
  * Returns the posted/get taxonomy value if it is set.
  *
  * @return string|null
  */
 private function get_taxonomy()
 {
     if (defined('DOING_AJAX') && DOING_AJAX === true) {
         return FILTER_INPUT(INPUT_POST, 'taxonomy');
     }
     return FILTER_INPUT(INPUT_GET, 'taxonomy');
 }
Esempio n. 2
0
 /**
  * @param string $param
  * @return mixed
  */
 private function filterInputServer($param)
 {
     return FILTER_INPUT(INPUT_SERVER, $param);
 }
Esempio n. 3
0
 public function save()
 {
     $profile_section = FILTER_INPUT(INPUT_POST, 'section', FILTER_SANITIZE_STRING);
     $post_data = array();
     $validate_section = null;
     $fields_for_select = array();
     $this->load->model('Field_editor_model');
     $this->Field_editor_model->initialize($this->Users_model->form_editor_type);
     if ($profile_section != 'view' && $profile_section != 'wall' && $profile_section != 'gallery' && $profile_section != 'subscriptions') {
         $section = $this->Field_editor_model->get_section_by_gid($profile_section);
         if (!empty($section)) {
             $fields_for_select = $this->Field_editor_model->get_fields_for_select($section['gid']);
         }
     } elseif ($profile_section == 'view') {
         $sections = $this->Field_editor_model->get_section_list();
         $sections_gids = array_keys($sections);
         $fields_for_select = $this->Field_editor_model->get_fields_for_select($sections_gids);
     }
     $this->Users_model->set_additional_fields($fields_for_select);
     if ($profile_section == 'personal') {
         $args = array('looking_user_type' => FILTER_SANITIZE_STRING, 'nickname' => FILTER_SANITIZE_STRING, 'fname' => FILTER_SANITIZE_STRING, 'sname' => FILTER_SANITIZE_STRING, 'id_country' => FILTER_SANITIZE_STRING, 'id_region' => FILTER_VALIDATE_INT, 'id_city' => FILTER_VALIDATE_INT, 'birth_date' => FILTER_SANITIZE_STRING, 'age_min' => FILTER_VALIDATE_INT, 'age_max' => FILTER_VALIDATE_INT, 'user_logo' => FILTER_SANITIZE_STRING);
         $post_data = filter_input_array(INPUT_POST, $args);
     } else {
         foreach ($fields_for_select as $field) {
             $post_data[$field] = $this->input->post($field, true);
         }
         $validate_section = $profile_section;
     }
     $validate_data = $this->Users_model->validate($this->user_id, $post_data, 'user_icon', $validate_section, 'save');
     $data = $validate_data['data'];
     if (empty($validate_data['errors'])) {
         if ($this->input->post('user_icon_delete') || isset($_FILES['user_icon']) && is_array($_FILES['user_icon']) && is_uploaded_file($_FILES['user_icon']['tmp_name'])) {
             $this->load->model('Uploads_model');
             if (!empty($data['user_logo_moderation'])) {
                 $this->Uploads_model->delete_upload($this->Users_model->upload_config_id, $this->user_id . '/', $data['user_logo_moderation']);
                 $validate_data['data']['user_logo_moderation'] = '';
                 $this->load->model('Moderation_model');
                 $this->Moderation_model->delete_moderation_item_by_obj($this->Users_model->moderation_type, $this->user_id);
             } elseif (!empty($data['user_logo'])) {
                 $this->Uploads_model->delete_upload($this->Users_model->upload_config_id, $this->user_id . '/', $data['user_logo']);
                 $validate_data['data']['user_logo'] = '';
             }
         }
         $this->Users_model->save_user($this->user_id, $validate_data['data'], 'user_icon');
         $this->load->model('users/models/Auth_model');
         $this->Auth_model->update_user_session_data($this->user_id);
     }
     $this->set_api_content('validate_data', $validate_data);
 }
<?php

require_once 'lib' . DIRECTORY_SEPARATOR . 'mongo.php';
$a = FILTER_INPUT(INPUT_GET, 'a', FILTER_SANITIZE_STRING);
$m = new mongoCustom();
if (method_exists($m, $a)) {
    call_user_func(array($m, $a));
}