fkooman\RemoteStorage\RemoteStorageService::stripQuotes PHP Method

stripQuotes() public method

ETag/If-Match/If-None-Match are always quoted, this method removes the quotes.
public stripQuotes ( $versionHeader )
    public function stripQuotes($versionHeader)
    {
        if (null === $versionHeader) {
            return;
        }
        $versions = array();
        if ('*' === $versionHeader) {
            return array('*');
        }
        foreach (explode(',', $versionHeader) as $v) {
            $v = trim($v);
            $startQuote = strpos($v, '"');
            $endQuote = strrpos($v, '"');
            $length = strlen($v);
            if (0 !== $startQuote || $length - 1 !== $endQuote) {
                throw new BadRequestException('version header must start and end with a double quote');
            }
            $versions[] = substr($v, 1, $length - 2);
        }
        return $versions;
    }