ソースを参照

Merge pull request #143 from dutchcoders/FIX-GDRIVE-FILENAME-ESCAPING

Escape quoting chars in filename for gdrive
tags/v1.0.0
Andrea Spacca 5年前
committed by GitHub
コミット
a640bcf707
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更4行の追加0行の削除
  1. +4
    -0
      server/storage.go

+ 4
- 0
server/storage.go ファイルの表示

@@ -21,6 +21,7 @@ import (
"google.golang.org/api/googleapi"
"io/ioutil"
"net/http"
"strings"
)

type Storage interface {
@@ -391,6 +392,9 @@ func (s *GDrive) list(nextPageToken string, q string) (*drive.FileList, error) {
}

func (s *GDrive) findId(filename string, token string) (string, error) {
filename = strings.Replace(filename, `'`, `\'`, -1)
filename = strings.Replace(filename, `"`, `\"`, -1)

fileId, tokenId, nextPageToken := "", "", ""

q := fmt.Sprintf("'%s' in parents and name='%s' and mimeType='%s' and trashed=false", s.rootId, token, GDriveDirectoryMimeType)


読み込み中…
キャンセル
保存