Escapes string for statement usage
@param string $data
@return string
4047
public function escape($data) {

		if(null === $data) {
			return $data;
		}

		if(false === is_string($data) && false === is_numeric($data)) {
			return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, float or int, "%s" given', __METHOD__, gettype($data)), E_USER_ERROR);
		}

		if(null === $this -> connection) {
			$this -> connect();
		}

		return $this -> connection -> real_escape_string($data);
	}
898944
function escape_data(&$value){
    // quick fix for ' character
    /** @todo have a proper function escaping all these */
    if(is_string($value)){
        $value = htmlspecialchars_decode($value);
        $value = self::strip_html_tags($value);
        $value = htmlentities($value);
        $value = stripslashes($value);
        $value = preg_replace('/\'/','´', $value);
        $value = addslashes($value);
        pr($value);
    }
  }
463785
private static function escape( $string )
	{
		$replace	= array(
			'\\'	=> '\\\\',
			'"'	=> '\"',
			'/'	=> '\/',
			"\b"	=> '\b',
			"\f"	=> '\f',
			"\n"	=> '\n',
			"\r"	=> '\r',
			"\t"	=> '\t',
			"\u"	=> '\u'
			);
		$string	= str_replace( array_keys( $replace ), array_values( $replace ), $string );
		return $string;
	}
289559
public function encode($data): string
    {
        $encoded = \json_encode($data, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE);
        if (\json_last_error() !== JSON_ERROR_NONE) {
            throw new EncodingException(\json_last_error_msg());
        }
        return $encoded;
    }
160374
public function encode($data)
    {
        if ($data !== null) {
            $data = gzencode((string) $data, $this->options['level'], $this->options['mode']);
            if ($data === false) {
                $data = null;
                $this->error = error_get_last()['message'] ?? 'Unknown';
            }
        }

        return $data;
    }
1113130
public static function escape($str, $quote = '`')
    {
        if (is_array($str)) {
            foreach ($str as $key => $value) {
                $str[$key] = static::escape($value);
            }

            return $str;
        }

        if ((static::$MODE & self::SQL_MODE_NO_ENCLOSING_QUOTES)
            && (! static::isKeyword($str, true))
        ) {
            return $str;
        }

        if (static::$MODE & self::SQL_MODE_ANSI_QUOTES) {
            $quote = '"';
        }

        return $quote . str_replace($quote, $quote . $quote, $str) . $quote;
    }
1203570
public static function encode($data): string
    {
        if (PHP_VERSION_ID >= 50400) {
            return json_encode($data, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
        }

        return json_encode($data);
    }
578741
protected function _unserialize($data)
	{
		$data = @unserialize(stripslashes($data));

		if (is_array($data))
		{
			foreach ($data as $key => $val)
			{
				if (is_string($val))
				{
					$data[$key] = str_replace('{{slash}}', '\\', $val);
				}
			}

			return $data;
		}

		return (is_string($data)) ? str_replace('{{slash}}', '\\', $data) : $data;
	}
856053
static public function encode($data)
	{
	    if (is_array($data)) {
	        foreach ($data as $k=>$v) {
	            if (is_array($v)) {
	                if (empty($v)) {
	                    $data[$k] = null;
	                } else {
	                    $data[$k] = implode('|', $v);
	                }
	            }
	        }
	        $data = implode(",", $data);
	    } elseif ((is_object($data) && !method_exists($data, '_toString'))) {
	        throw new \InvalidArgumentException(__CLASS__ . ' can not handle an array or non-stringable object.');
	    }

		return $data;
	}
545778
static public function encode($data)
	{
	    if (is_string($data)) {
	        $data = str_replace(array("\r\n"), "", $data);
	        if (strpos($data, '{') ===0 || strpos($data, '[') ===0) {
	            $data = json_decode($data, true);
	        }
	    }
	    
		return json_encode($data);
	}
47953
public static function utf8Decode($data) {
		if (is_string($data)) {
			return utf8_decode($data);

		} else if (is_array($data)) {
			foreach ($data as $key => $value) {
				$data[utf8_decode($key)] = self::utf8Decode($value);
			}

		} else if (is_object($data)) {
			foreach ($data as $key => $value) {
				$data->{$key} = self::utf8Decode($value);
			}
		}

		return $data;
	}
958658
public static String escapeString(String data) {
    return StringUtils.escapeString(data, StringUtils.ESCAPE_CHAR, 
                                    charsToEscape);
  }
1195858
public static function seal(string $data): string
    {
        $publicKey = self::getPublicKey();
        
        // compute signature
        $sealed = null;
        $ekeys = array();
        
        $success = openssl_seal($data, $sealed, $ekeys, array(
            $publicKey
        ));
        if (!$success) {
            return $sealed;
        }
        
        $sealkey = $ekeys[0];
        
        // free the key from memory;
        openssl_free_key($publicKey);
        
        return self::base64UrlEncode($sealed) . '|' . self::base64UrlEncode($sealkey);
    }
1240560
public function encode($data) : string
    {
        $result = json_encode($data, $this->options, $this->maxDepth);

        $this->checkLastError();

        return $result;
    }
1029996
public static function escapeValues(array $data, \mysqli $mysqli)
    {
        foreach($data as $index => $value)
        {
            if ($value !== null)
            {
                $data[$index] = mysqli_escape_string($mysqli, $value);
            }
        }
        
        return $data;
    }
589148
public static function escapeWithDoubleQuotes(string $value): string
    {
        return sprintf('"%s"', str_replace(self::$escapees, self::$escaped, $value));
    }
1215061
public function escape($string)
    {
        if (is_string($string)) {
            $func = $this->escape;
            return $func($string);
        }
        return $string;
    }