Normalize quotes

@param string $value the value to convert
@return string
516324
public function convertQuotes($value)
    {
        // normalize different quotes to "
        $pattern = array('\'', '`', '´', '’', '‘');
        $value   = str_replace($pattern, '"', $value);
        //make sure harmless quoted strings don't generate false alerts
        $value = preg_replace('/^"([^"=\\!><~]+)"$/', '$1', $value);
        return $value;
    }
241035
public static function stripQuotes($value): string
    {
        if ($value[0] === '"' && substr($value, -1) === '"') {
            $value = trim($value, '"');
        }

        if ($value[0] === "'" && substr($value, -1) === "'") {
            $value = trim($value, "'");
        }

        return $value;
    }
41562
private function quoteValue($value)
    {
        if (is_numeric($value)) {
            return $value;
        }

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

        return $this->getConnection()->quote($value);
    }
1344680
protected function _sanitize($value)
    {
        $value = parent::_sanitize($value);
        $pattern = '/[()<\/>\"\']*/';
        $value = preg_replace_callback($pattern, function($matches) { return '';} , $value);

        return $value;
    }
98607
public function transform(string $value): string {
        
        if (strpos($value, 'hdl.handle.net') !== false) {
            $value = str_replace("http://", "", $value);
        }else if(strpos($value, 'https') !== false) {
            $value = str_replace("https://", "", $value);
        }else {
            $value = str_replace("http://", "", $value);
        }
        return $value;
        
    }
1023443
protected function substituteConstantTemplates($value) {
        $lines = array();
        foreach(explode(PHP_EOL, $value) as $line) {
            $quote = substr(trim($line), 0, 1);
            $line = preg_replace_callback(
                '~{([\w]+)}~',
                function($matches) use ($quote) {
                    $matches[1] = $quote . '.' . $matches[1] . '.' . $quote;
                    return $matches[1];
                },
                $line
            );
            $lines[] = str_replace(array($quote.$quote . '.', '.' . $quote.$quote), '', $line);
        }
        return implode(PHP_EOL, $lines);
    }
165405
public function quoteString(?string $value): string
  {
    if ($value===null || $value==='') return 'null';

    return "'".$this->mysqli->real_escape_string($value)."'";
  }
1198606
protected function _quote($value)
    {
        if (is_int($value)) {
            return $value;
        } elseif (is_float($value)) {
            return sprintf('%F', $value);
        }

        return "'" . str_replace("'", "''", $value) . "'";
    }
673054
protected function encodeQuorum($value)
    {
        if (isset(self::$encode[$value])) {
            return self::$encode[$value];
        }

        return $value;
    }
29275
public function quote(?string $value): string
    {
        if ($value === null) {
            return 'NULL';
        }

        return $this->pdo->quote($value);
    }
359836
public static function convertFromConcatenated($value)
    {
        //normalize remaining backslashes
        if ($value != preg_replace('/(\w)\\\/', "$1", $value)) {
            $value .= preg_replace('/(\w)\\\/', "$1", $value);
        }

        $compare = stripslashes($value);

        $pattern = array(
            '/(?:<\/\w+>\+<\w+>)/s',
            '/(?:":\d+[^"[]+")/s',
            '/(?:"?"\+\w+\+")/s',
            '/(?:"\s*;[^"]+")|(?:";[^"]+:\s*")/s',
            '/(?:"\s*(?:;|\+).{8,18}:\s*")/s',
            '/(?:";\w+=)|(?:!""&&")|(?:~)/s',
            '/(?:"?"\+""?\+?"?)|(?:;\w+=")|(?:"[|&]{2,})/s',
            '/(?:"\s*\W+")/s',
            '/(?:";\w\s*\+=\s*\w?\s*")/s',
            '/(?:"[|&;]+\s*[^|&\n]*[|&]+\s*"?)/s',
            '/(?:";\s*\w+\W+\w*\s*[|&]*")/s',
            '/(?:"\s*"\s*\.)/s',
            '/(?:\s*new\s+\w+\s*[+",])/',
            '/(?:(?:^|\s+)(?:do|else)\s+)/',
            '/(?:[{(]\s*new\s+\w+\s*[)}])/',
            '/(?:(this|self)\.)/',
            '/(?:undefined)/',
            '/(?:in\s+)/'
        );

        // strip out concatenations
        $converted = preg_replace($pattern, null, $compare);

        //strip object traversal
        $converted = preg_replace('/\w(\.\w\()/', "$1", $converted);

        // normalize obfuscated method calls
        $converted = preg_replace('/\)\s*\+/', ")", $converted);

        //convert JS special numbers
        $converted = preg_replace(
            '/(?:\(*[.\d]e[+-]*[^a-z\W]+\)*)|(?:NaN|Infinity)\W/ims',
            1,
            $converted
        );

        if ($converted && ($compare != $converted)) {
            $value .= "\n" . $converted;
        }

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

        return $char . str_replace($char, '', $value) . $char;
    }
1360286
protected function _quote($value)
    {
        if (is_int($value) || is_float($value)) {
            return $value;
        }
        /**
         * Use db2_escape_string() if it is present in the IBM DB2 extension.
         * But some supported versions of PHP do not include this function,
         * so fall back to default quoting in the parent class.
         */
        if (function_exists('db2_escape_string')) {
            return "'" . db2_escape_string($value) . "'";
        }
        return parent::_quote($value);
    }
85301
private function encodeNonTranslatableCharacters(string $value): string
    {
        return str_replace(
            array_keys($this->nonTranslatableCharactersHashMap),
            array_values($this->nonTranslatableCharactersHashMap),
            $value
        );
    }
463223
function quote($value)
  {
    if ($value === null)
      return 'null';

    assert (!is_object($value));

    if (is_bool($value))
      return (int) $value;

    // Protect digit sequences beginning with '0' (eg phone numbers)
    if (is_string($value) && substr($value, 0,1) == "0")
     return "'".$this->real_escape_string($value)."'";

    if (is_numeric($value))
      return $value;

    // Create comma separated lists for arrays.
    if (is_array($value))
    {
      $res = [];
      foreach ($value as $v)
      {
        if (is_array($v))
          $res[] = "(".$this->quote($v).")";
        else
          $res[] = $this->quote($v);
      }
      return implode(",",$res);
    }

    return "'".$this->real_escape_string($value)."'";
  }
1320111
public function normalizeValue($value)
	{
		if ($value instanceof AbstractNormalization)
		{
			return $value;
		}

		if (is_callable($value))
		{
			return new Custom($value);
		}

		$className = 's9e\\TextFormatter\\Configurator\\TemplateNormalizations\\' . $value;

		return new $className;
	}
513511
public function transform($value)
    {
        if ( $value ) {
            $from = '';
            if ( $value->getFrom() ) {
                $from = $value->getFrom()->format('Y-m-d');
            }
            $to = '';
            if ( $value->getTo() ) {
                $to = $value->getTo()->format('Y-m-d');
            }
            return sprintf(
                '%s%s%s',
                $from,
                $this->dateSeparator,
                $to
            );
        }
    }