瀏覽代碼

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)


Loading…
取消
儲存