瀏覽代碼

Escape quoting chars in filename for gdrive

tags/v1.0.0
Andrea Spacca 5 年之前
父節點
當前提交
e7051e9b31
共有 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…
取消
儲存