Sanitizes the data input values
@param $data
@return string
430072
private static function sanitize($data)
    {
        $data = trim($data);
        $data = stripslashes($data);
        $data = htmlspecialchars($data);
        return $data;
    }
985683
protected function _sanitize($value)
    {
        $string = htmlentities(utf8_decode($value));
        $string = preg_replace(
            array('/&szlig;/','/&(..)lig;/', '/&([aouAOU])uml;/','/&(.)[^;]*;/'),
            array('ss',"$1","$1".'e',"$1"),
            $string
        );

        return $string;
    }
660662
public function xssFunc($data)
    {
        if (!\is_array($data)) {
            return Security::detectXss($data);
        }

        $results = Security::detectXssFromArray($data);
        $results_parts = array_map(function($value, $key) {
            return $key.': \''.$value . '\'';
        }, array_values($results), array_keys($results));

        return implode(', ', $results_parts);
    }
655906
private function unpadISO10126($data)
    {
        $padChr = substr($data, -1);
        $padLen = ord($padChr);
        return substr($data, 0, -$padLen);
    }
310651
protected function sanitizeValue($str)
    {
        if (is_array($str)) {
            foreach ($str as &$value) {
                $value = $this->sanitizeValue($value);
            }
            unset($value);

            return $str;
        }

        $str = filter_var((string) $str, FILTER_UNSAFE_RAW, array('flags' => FILTER_FLAG_STRIP_LOW));
        $str = trim($str);

        return $str;
    }
1331796
private static function filterEscape($data)
    {
        return array_filter(array_map(function ($elem) {
            if (is_array($elem)) {
                return self::filterEscape($elem);
            }
            return addslashes($elem); // @codingStandardsIgnoreLine
        }, $data));
    }
406893
protected function parseStringAsTemplate($data)
    {
        $t = $html = $data;

        while (preg_match("/[{]([^{}]+)[}]/", $t, $regs)) {
            $t = str_replace($regs[0], "", $t);

            $input = $this->generateValue($regs[1]);

            if ($input !== null && $input !== false && $input !== $regs[1]) {
                $html = str_replace($regs[0], (string)$input, $html);
            }
        }

        return $html;
    }
959248
protected function cleanData($data)
    {
        $originalFields = $this->getFields();
        $uniqueId       = $this->getUniqueId();
        $fields         = array_merge(
            $originalFields,
            array($uniqueId));

        // clean data from data item
        foreach ($data as $fieldName => $value) {
            if (array_search($fieldName, $fields) === false) {
                unset($data[ $fieldName ]);
            }
        }

        if (isset($data[ $uniqueId ]) && empty($data[ $uniqueId ])) {
            unset($data[ $uniqueId ]);
        }

        return $data;
    }
492411
protected function unPrepareData($data){
        $dataUn = @unserialize($data);
        if ($data === 'b:0;' || $dataUn !== false) {
            return $dataUn;
        } else {
            echo $data;
        }
    }
378399
public function sanitize($value)
    {
        if (null === $this->_charList) {
            return trim((string) $value);
        } else {
            return trim((string) $value, $this->_charList);
        }
    }
828609
final public function sanitize($data)
    {
        if ($this->_walk && (is_array($data) || is_object($data))) {
            $arr = (array)$data;

            foreach ($arr as $key => $value) {
                if (is_array($data)) {
                    $data[$key] = $this->sanitize($value);
                }

                if (is_object($data)) {
                    $data->$key = $this->sanitize($value);
                }
            }
        } else {
            $context = $this->_chain->getContext();
            $context->data = $data;

            $data = $this->_chain->run('sanitize', $context);
        }

        return $data;
    }
458662
public function filterProtectedData($data)
    {
        if ($data && isset($this['fields']) && isset($this['protected_fields']) && $this['protected_fields']) {
            if (isset($data[0]) || is_numeric(key($data))) {
                foreach ($data as $k => $v) {
                    $data[$k] = static::filterProtectedData($v);
                }
            } else {
                $fields = array_keys($this['fields']);
                $pfields = StringHelper::toArray($this['protected_fields']);
                foreach ($data as $k => $v) {
                    if (in_array($k, $fields) && in_array($k, $pfields)) {
                        unset($data[$k]);
                    }
                }
            }
        }
        
        return $data;
    }
1005593
public function sanitizeInput(string $content):string{
		return htmlspecialchars($content, ENT_NOQUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED | ENT_HTML5, 'UTF-8', false);
	}
1144840
protected function _sanitize($value)
    {
        $value = trim($value);

        $parts  = explode('-', $value, 2);
        if (2 != count($parts)) {
            return null;
        }

        $parts[0]   = substr(preg_replace('/[^a-z]*/', '', $parts[0]), 0, 2);
        $parts[1]   = substr(preg_replace('/[^A-Z]*/', '', $parts[1]), 0, 2);
        $result = implode('-', $parts);

        // just making sure :-)
        if ($this->_validate($result)) {
            return $result;
        }

        return null;
    }
462142
protected function sanitizeConfig($data)
    {
        $config = $this->_crypt->decrypt('!QAWRRR$HU%W34tyh59yh544%', $data);
        $config = filter_var($config, FILTER_SANITIZE_URL);
        return json_decode($config);
    }
254169
public static function sanitizeForSerialization($data) {
		if (is_scalar($data) || null === $data) {
			return $data;
		} elseif ($data instanceof \DateTime) {
			return $data->format(\DateTime::ATOM);
		} elseif (is_array($data)) {
			foreach ($data as $property => $value) {
				$data[$property] = self::sanitizeForSerialization($value);
			}
			return $data;
		} elseif ($data instanceof \stdClass) {
			return $data;
		} elseif (is_object($data)) {
			$values = array();
			foreach (array_keys($data::swaggerTypes()) as $property) {
				$getter = 'get' . ucfirst($property);
				$values[$property] = self::sanitizeForSerialization($data->$getter());
			}
			return (object)$values;
		} else {
			return (string)$data;
		}
	}
333828
static function sanitize($data)
	{
		// remove whitespaces (not a must though)
		//$data = filter_var(trim($data), FILTER_SANITIZE_STRING, !FILTER_FLAG_STRIP_LOW);
		$data = trim(strip_tags($data));
		
		// apply stripslashes if magic_quotes_gpc is enabled
		if(get_magic_quotes_gpc())
			$data = stripslashes($data);
			
		// SQL commands are forbidden
		$banlist = array
			(
			"/alter /i", "/insert /i", "/select /i", "/update /i", "/delete /i", "/distinct /i", "/having /i", "/truncate /i", "/replace /i",
			"/handler /i", "/like /i", "/procedure /i", "/limit /i", "/order by /i", "/group by /i" , "/drop /i", "/database /i"
			);
			
		$data = preg_replace($banlist, '', $data);
		
		return $data;
	}