Remove quotes used as a wrapper to identify string values

@param mixed $value
@return mixed
540086
public static function _unwrapResult($value) {
		if (is_string($value)) {
			if ((isset($value{0})) && ($value{0} == '"') && (substr($value,-1) == '"')) {
				return substr($value,1,-1);
			}
		//	Convert numeric errors to NaN error
		} else if((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) {
			return PHPExcel_Calculation_Functions::NaN();
		}
		return $value;
	}
733799
protected function _validate($value)
    {
        $value = trim($value);
        return (is_string($value) && ($value === filter_var($value, FILTER_SANITIZE_STRING, FILTER_FLAG_NO_ENCODE_QUOTES)));
    }
249468
public function quoteIfNecessary($value)
    {
        if ($this->isNumber($value) || $this->isPlaceholder($value)) {
            return $value;
        }

        return $this->quote($value);
    }
15029
protected function wrapValue($value)
    {
        if ($value === '*') {
            return $value;
        }

        // If the given value is a JSON selector we will wrap it differently than a
        // traditional value. We will need to split this path and wrap each part
        // wrapped, etc. Otherwise, we will simply wrap the value as a string.
        if (Str::contains($value, '->')) {
            return $this->wrapJsonSelector($value);
        }

        return '"' . str_replace('"', '""', $value) . '"';
    }
189492
private function escape($value)
    {
        if (1 !== preg_match($this->escapeCharacterPattern, $value)) {
            return htmlspecialchars($value, ENT_QUOTES);
        }

        return str_replace(
            $this->controlCharacters, $this->escapeCharacters, htmlspecialchars($value, ENT_QUOTES)
        );
    }
325785
public function clean($value)
  {
    // Return null for empty strings.
    if ($value==='' || $value===null || $value===false)
    {
      return null;
    }

    // Replace all ambiguous characters.
    $tmp = $value;
    foreach ($this->ambiguities as $unambiguity => $ambiguities)
    {
      foreach ($ambiguities as $ambiguity)
      {
        // Note: str_replace works fine with multi byte characters like UTF-8.
        $tmp = str_replace($ambiguity, $unambiguity, $tmp);
      }
    }

    // Restore EOL for DOS users.
    if (PHP_EOL!="\n") $tmp = str_replace("\n", PHP_EOL, $tmp);

    // Return null for empty strings.
    if ($tmp==='') $tmp = null;

    return $tmp;
  }
651521
public static function stripslashesDeep($value)
    {
        $value = is_array($value) ?
                    array_map(array('StringUtils', 'stripslashesDeep'), $value) :
                    stripslashes($value);

        return $value;
    }
452809
protected function getQuoteValue($value): string
    {
        $key = uniqid();
        $this->builder->setParameter($key, $value);

        return ":{$key}";
    }
1197030
public static function unescapeValue($value)
    {
        $callback = function ($matches) {
            return chr(hexdec($matches[1]));
        };

        return preg_replace_callback('/\\\([0-9A-Fa-f]{2})/', $callback, $value);
    }
1199643
protected static function sanitiseVariableValue($value)
        {
            $value = trim($value);

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

            if (strpbrk($value[0], '"\'') !== false) { // value starts with a quote
                $quote = $value[0];

                $regexPattern = sprintf('/^
                    %1$s          # match a quote at the start of the value
                    (             # capturing sub-pattern used
                     (?:          # we do not need to capture this
                      [^%1$s\\\\] # any character other than a quote or backslash
                      |\\\\\\\\   # or two backslashes together
                      |\\\\%1$s   # or an escaped quote e.g \"
                     )*           # as many characters that match the previous rules
                    )             # end of the capturing sub-pattern
                    %1$s          # and the closing quote
                    .*$           # and discard any string after the closing quote
                    /mx',
                    $quote
                );

                $value = preg_replace($regexPattern, '$1', $value);
                $value = str_replace("\\$quote", $quote, $value);
                $value = str_replace('\\\\', '\\', $value);
            } else {
                $parts = explode(' #', $value, 2);
                $value = $parts[0];
            }

            return trim($value);
        }
204211
public function _prepValues($value)
    {
        if (is_array($value)) {
            if (isset($value["func"])) {
                return $value["func"];
            }
            foreach ($value as &$param) {
                $this->params[] = $param;
                $param = "?";
            }
            unset($param);
            return $value;
        }
        if (in_array(is_string($value) ? strtolower($value) : $value, [null, "null"]) === false) {
            $this->params[] = $value;
            $value = "?";
        }
        return $value;
    }
346795
protected function _sanitize($value)
    {
        $value      = trim(strtolower($value));
        $pattern    = '/[^a-f0-9]*/';
        return substr(preg_replace($pattern, '', $value), 0, 32);
    }
1282555
public function quote($value)
    {
        if ($value === null) {
            return 'NULL';
        }
        if ($value instanceof DateTimeInterface) {
            return $this->pdo->quote($value->format('Y-m-d H:i:s'));
        }
        if (is_array($value)) {
            return implode(',', array_map([$this, 'quote'], $value));
        }
        if (is_bool($value)) {
            return $this->pdo->quote($value ? 1 : 0);
        }

        return $this->pdo->quote($value);
    }
1279328
public function clean($value)
  {
    if ($value==='' || $value===null || $value===false)
    {
      return null;
    }

    $tmp = AmbiguityCleaner::get()->clean($value);

    $tmp = str_replace([' ', "\t", "\n"], '', $tmp);
    if ($tmp==='') $tmp = null;

    return $tmp;
  }
921920
protected function _quote($value) {
        $char = $this->getConfig('quoteCharacter');

        return $char . str_replace($char, '', $value) . $char;
    }
394932
public function quote($value)
    {
        // If a PDO database connection is set, use it to quote the value using
        // the underlying database. Otherwise, quote it manually.
        if ($pdo = $this->getPdo()) {
            return $pdo->quote($value);
        }

        if (\is_numeric($value)) {
            return $value;
        }

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

        return "'" . \addslashes($value) . "'";
    }
887634
public static function filterAttribute($value)
    {
        // Check whether current string has already been encoded
        $isEncoded = TextUtils::strModified($value, function($target){
            return self::escape($target);
        });

        // Decode if previous encoded or escaped
        if ($isEncoded) {
            $value = self::charsDecode($value);
        }

        // Convert special characters to make safe use of them
        $value = self::specialChars($value);

        return $value;
    }