Quote strings coming from quoteName call.

@param   array $strArr Array of strings coming from quoteName dot-explosion.

@return  string  Dot-imploded string of quoted parts.

@since   2.0
485558
protected function quoteNameStr($strArr)
    {
        $parts = [];
        $q = $this->nameQuote;

        foreach ($strArr as $part) {
            if (null === $part) {
                continue;
            }

            if (strlen($q) == 1) {
                $parts[] = $q . $part . $q;
            } else {
                $parts[] = $q{0} . $part . $q{1};
            }
        }

        return implode('.', $parts);
    }
999349
public function quote($value)
    {
        if (is_array($value)) {
            $result = [];
            foreach ($value as $single) {
                $result[] = $this->quote($single);
            }
            return sprintf(
                '(%s)',
                implode(', ', $result)
            );
        } else {
            return $this->pdo->quote($value);
        }
    }
95734
public static function decodeStrArray($strArray)
    {
        $str = '';
        foreach ($strArray as $encode => $part) {
            $encodedStr = '';
            foreach ($part as $type => $strings) {
                if ($type === 'B') {
                    $resultStr = is_array($strings) ? implode(array_map('base64_decode', $strings)) : base64_decode($strings);
                } elseif ($type === 'Q') {
                    $resultStr = is_array($strings) ? implode($strings) : $strings;
                    $resultStr = quoted_printable_decode($resultStr);
                }
                $encodedStr .= $resultStr;
            }

            $str .= mb_convert_encoding($encodedStr, 'UTF-8', $encode);
        }

        return $str;
    }
289973
public function quote($string)
    {
        if ($quoter = $this->quoter()) {
            return $quoter($string);
        }
        $replacements = array(
            "\x00"=>'\x00',
            "\n"=>'\n',
            "\r"=>'\r',
            "\\"=>'\\\\',
            "'"=>"\'",
            "\x1a"=>'\x1a'
        );
        return "'" . strtr(addcslashes($string, '%_'), $replacements) . "'";
    }
1279817
public static function getString(&$str)
    {
        $p = strpos($str, "\x00");
        if ($p === false) {
            return '';
        }
        $r   = static::binarySubstr($str, 0, $p);
        $str = static::binarySubstr($str, $p + 1);

        return $r;
    }
601946
public static function values($arr)
    {
        if (!is_array($arr)) {
            return '';
        }
        $arr = array_values($arr);
        foreach ($arr as &$v) {
            $v = static::value($v);
        }
        return implode(',', $arr);
    }
156867
public function getQuotedName(string $str): string
    {
        $platform = $this->connection->getDatabasePlatform();
        $keywords = $platform->getReservedKeywordsList();
        $parts = explode('.', $str);
        foreach ($parts as $k => $v) {
            $parts[$k] = ($keywords->isKeyword($v)) ? $platform->quoteIdentifier($v) : $v;
        }

        return implode('.', $parts);
    }
22380
private static function getNextQuotedPrintableToken($str)
    {
        if(substr($str, 0, 1) == "=") {
            $token = substr($str, 0, 3);
        } else {
            $token = substr($str, 0, 1);
        }
        return $token;
    }
92320
public static String quoteEscaped(final String str) {
        if (N.isNullOrEmpty(str)) {
            return str;
        }

        final StringBuilder sb = Objectory.createStringBuilder();
        final char[] chars = getCharsForReadOnly(str);

        try {
            char ch = 0;
            for (int i = 0, len = str.length(); i < len; i++) {
                ch = chars[i];

                if ((ch == _BACKSLASH) && (i < (len - 1))) {
                    sb.append(ch);
                    sb.append(str.charAt(++i));
                } else if ((ch == _QUOTATION_S) || (ch == _QUOTATION_D)) {
                    sb.append(_BACKSLASH);
                    sb.append(ch);
                } else {
                    sb.append(ch);
                }
            }

            return sb.toString();
        } finally {
            Objectory.recycle(sb);
        }
    }
350679
public static function charsToNormalTitle(string $s): string
    {
        if (is_array($s)) {
            $res = [];

            foreach ($s as $k => $v) {
                $res[$k] = strtr(ucfirst(strtolower($v)), ['_' => ' ']);
            }

            $s = $res;
        } elseif (is_string($s)) {
            $s = strtr(ucfirst(strtolower($s)), ['_' => ' ']);
        }

        return $s;
    }
1207227
public function quoteIdentifier($value)
    {
        if ($value instanceof Expr) {
            return $value->getValue();
        }

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

        $pieces = explode('.', $value);

        foreach ($pieces as $key => $piece) {
            $pieces[$key] = '`'.$piece.'`';
        }

        return implode('.', $pieces);
    }
828492
public static function getString(&$str)
    {
        $p = mb_orig_strpos($str, "\x00");
        if ($p === false) {
            return '';
        }
        $r = mb_orig_substr($str, 0, $p);
        $str = mb_orig_substr($str, $p + 1);
        return $r;
    }
1085838
static function escape_string($str)
    {
        if (is_array($str) && count($str) > 1) {
            foreach ($str as $idx => $val)
                $str[$idx] = self::escape_string($val);

            return '[' . implode(',', $str) . ']';
        }
        else if (is_array($str)) {
            $str = array_pop($str);
        }

        // multi-line string
        if (preg_match('/[\r\n\0]/', $str)) {
            return sprintf("text:\n%s\n.\n", self::escape_multiline_string($str));
        }
        // quoted-string
        else {
            return '"' . addcslashes($str, '\\"') . '"';
        }
    }
1060046
static function escape_multiline_string($str)
    {
        $str = preg_split('/(\r?\n)/', $str, -1, PREG_SPLIT_DELIM_CAPTURE);

        foreach ($str as $idx => $line) {
            // dot-stuffing
            if (isset($line[0]) && $line[0] == '.') {
                $str[$idx] = '.' . $line;
            }
        }

        return implode($str);
    }
1245805
@Nullable
  public static String quote(@Nullable final String str) {
    return str != null ? "'" + str + "'" : null;
  }
1038558
public function Escape( $str ) {
		$this->connect();
		return substr(substr($this->pdo->quote($str), 1), 0, -1);
	}
861272
protected function _rfc822ParseQuotedString(&$str)
    {
        if ($this->_curr(true) != '"') {
            throw new Horde_Mail_Exception('Error when parsing a quoted string.');
        }

        while (($chr = $this->_curr(true)) !== false) {
            switch ($chr) {
            case '"':
                $this->_rfc822SkipLwsp();
                return;

            case "\n":
                /* Folding whitespace, remove the (CR)LF. */
                if (substr($str, -1) == "\r") {
                    $str = substr($str, 0, -1);
                }
                break;

            case '\\':
                if (($chr = $this->_curr(true)) === false) {
                    break 2;
                }
                break;
            }

            $str .= $chr;
        }

        /* Missing trailing '"', or partial quoted character. */
        throw new Horde_Mail_Exception('Error when parsing a quoted string.');
    }