Explorar o código

[export] When exporting query result to excel it create's wrong HYPERLINK's for results with http GH-1889 (asnaik) (#1890)

Co-authored-by: Akhil Naik <asnaik@cloudere.com>
Akhil S Naik %!s(int64=5) %!d(string=hai) anos
pai
achega
2fbbfc665d
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      desktop/core/src/desktop/lib/export_csvxls.py

+ 1 - 1
desktop/core/src/desktop/lib/export_csvxls.py

@@ -72,7 +72,7 @@ def encode_row(row, encoding=None, make_excel_links=False):
     if isinstance(cell, six.string_types):
       cell = re.sub(ILLEGAL_CHARS, '?', cell)
       if make_excel_links:
-        cell = re.compile('(https?://.+)', re.IGNORECASE).sub(r'=HYPERLINK("\1")', cell)
+        cell = re.compile('^(https?://.+)', re.IGNORECASE).sub(r'=HYPERLINK("\1")', cell)
     cell = nullify(cell)
     if not isinstance(cell, numbers.Number):
       cell = smart_str(cell, encoding, strings_only=True, errors='replace')