Secures Conditions Value by adding slashes or quoting.
@access		protected
@param		string		$value		String to be secured
@return		string
191788
protected function secureValue( $value ){
#		if( !ini_get( 'magic_quotes_gpc' ) )
#			$value = addslashes( $value );
#		$value	= htmlentities( $value );
		if ( $value === NULL )
			return "NULL";
		$value	= $this->dbc->quote( $value );
		return $value;
	}
541490
public function quoteIdentifier($value)
    {
        $quote = false;
        switch ($this->getConfig()->get(Formatter::CFG_QUOTE_IDENTIFIER_STRATEGY)) {
            case Formatter::QUOTE_IDENTIFIER_AUTO:
                $quote = ReservedWords::isReserved($value);
                break;

            case Formatter::QUOTE_IDENTIFIER_ALWAYS:
                $quote = true;
                break;
        }

        return $quote ? '`'.$value.'`' : $value;
    }
1181812
public static function sanitizeInputValue($value)
    {
        $value = self::sanitizeLineBreaks($value);
        $value = self::sanitizeString($value);
        return $value;
    }
200982
public function quote($value)
    {
        if( null === $value ) {
            return 'NULL';
        } else if( is_bool($value) ) {
            return ( $value ? '1' : '0' );
        } else if( $value instanceof Expression ) {
            return (string) $value;
        } else if( is_integer($value) ) {
            return sprintf('%d', $value);
        } else if( is_float($value) ) {
            return sprintf('%f', $value); // @todo make sure precision is right
        } else {
            return "'" . $this->getConnection()->real_escape_string($value) . "'";
        }
    }
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;
    }
56120
protected function sanitizeNodeToValue($value)
    {
        $first = strpos($value, '>')+1;
        $last = strrpos($value, '<')-$first;
        $value = substr($value, $first, $last);
        $value = str_replace('"', "'", $value);
        return trim($value);
    }
197572
public function escapeAndQuote($value)
    {
        if (null === $value) {
            $pdoType = \PDO::PARAM_NULL;
        } else {
            $pdoType = \PDO::PARAM_STR;
        }

        return $this->getPdo()->quote($value, $pdoType);
    }
370668
protected function _validate_url($value)
    {
        if ($value === '') {
            return '';
        }

        if (strpos($value, '://') === false) {
            $value = 'http://' . $value;
        }

        return filter_var($value, FILTER_VALIDATE_URL) !== false ? $value : null;
    }
89002
public function value($value)
    {
        //terminal case
        if (!is_array($value)) {
            if (strpbrk($value, Lexer::ESCAPED_STRING) !== false) {
                if (!(substr($value, 0, 1) == '"' && substr($value, -1) == '"')) {
                    return '(' . addcslashes($value, Lexer::ESCAPED_STRING_PAREN_ENCAPSED) . ')';
                }
            }
            return $value;
        }

        //composite value case
        $pairs = array();
        foreach ($value as $key => $subval) {
            $pairs[] = "{$this->identifier($key)} = {$this->value($subval)}";
        }

        return '(' . implode(', ', $pairs) . ')';
    }
880537
public function sanitize($value)
    {
        //remove any quotation and replace with whitespace
        $value = preg_replace('/\"/', '', $value);

        //remove any '-' from the string they will be used as concatonater
        $value = str_replace($this->_separator, ' ', $value);

        //convert to ascii characters
        $value = $this->getObject('lib:filter.ascii')->sanitize($value);

        //lowercase and trim
        $value = trim(strtolower($value));

        //remove any duplicate whitespace, and ensure all characters are alphanumeric
        $value = preg_replace(array('/\s+/','/[^A-Za-z0-9\-]/'), array($this->_separator,''), $value);

        //remove repeated occurrences of the separator
        $value = preg_replace('/['.preg_quote($this->_separator, '/').']+/', $this->_separator, $value);

        //limit length
        if (strlen($value) > $this->_length) {
            $value = substr($value, 0, $this->_length);
        }

        //remove unwanted separators from the ends
        $value = trim($value, $this->_separator);

        return $value;
    }
1101114
protected function _validate_url($value)
    {
        $value = trim($value);

        if ($value === '') {
            return '';
        }

        if (filter_var($value, FILTER_VALIDATE_URL) !== false) {
            $parts = explode('://', $value, 2);
            $scheme = strtolower($parts[0]);
            $path = $parts[1];
            if ($scheme !== 'http' && $scheme !== 'https') {
                return null;
            } else {
                return $scheme . '://' . $path;
            }
        } else {
            return null;
        }
    }
10464
protected function _quote($value)
    {
        if (is_int($value) || is_float($value)) {
            return $value;
        }
        $this->_connect();
        return "'" . $this->_connection->real_escape_string($value) . "'";
    }
879219
protected function _sanitize($value)
    {
        //strip php tags
        $value = preg_replace('/<\\?.*(\\?>|$)/Us', '', $value);
        $value = parent::_sanitize($value);

        return $value;
    }
558915
public function sanitize($value)
    {
        $value = (string) $value;

        // Filter var for XSS and other 'bad' code etc.
        if (!empty ($value)) {
            $value = $this->_remove($this->_decode($value));
        }

        return $value;
    }
1099327
protected static function _stripSlashes($value)
    {
        if (! is_object($value)) {
            $value = is_array($value) ? array_map(array( 'AnRequest', '_stripSlashes' ), $value) : stripslashes($value);
        }

        return $value;
    }
1158745
public static function prep_value($value) {
		if (\is_array($value)) {
			$value=implode(",", $value);
		}
		if (self::containsCode($value)===false) {
			$value=\str_replace(["\\","\""], ["\\\\","\\\""], $value);
			$value='"'.$value.'"';
		}
		return trim($value,"%");
	}
1009225
public function sanitize($value)
    {
        $value = JApplicationHelper::stringURLSafe($value);

        //limit length
        if (mb_strlen($value) > $this->_length) {
            $value = mb_substr($value, 0, $this->_length);
        }

        return $value;
    }