function filter_untrusted_input

7.x misc.inc filter_untrusted_input($string, $type = 'major_code')

When receiving certain input from the user, filter out potential trouble characters

Parameters

$type This is the type of input we are expecting. For example, the default is "major_code", which means: the input should exclude any characters not normally found in a major_code.

9 calls to filter_untrusted_input()
advise.module in modules/advise/advise.module
advise_init in modules/advise/advise.module
Implementation of hook_init
advise_init_advising_variables in modules/advise/advise.module
Takes various variables from the REQUEST and stores them in our advising_session_variables table for more convenient use later on.
advise_init_screen in modules/advise/advise.module
AdvisingScreen.php in classes/AdvisingScreen.php

... See full list

File

includes/misc.inc, line 1252
This file contains misc functions for FlightPath

Code

function filter_untrusted_input($string, $type = 'major_code') {

  if (!$string) {
    $string = '';
  }

  if ($type == 'major_code') {
    $string = filter_xss($string, array());

    $string = str_replace('"', '', $string);
    $string = str_replace("'", '', $string);
    $string = str_replace("(", '', $string);
    $string = str_replace(")", '', $string);
    $string = str_replace("#", '', $string);
    $string = str_replace("=", '', $string);
    $string = str_replace(" ", '', $string);
    $string = str_replace(";", '', $string);

  }

  return $string;
}