Skip to content

Commit

Permalink
On windows, brive cannot create a file with a / character, thinking…
Browse files Browse the repository at this point in the history
… it's part of a folder. This removes any / character from the document title as an illegal character.
  • Loading branch information
Dave Barnum committed Feb 21, 2018
1 parent bc8f36d commit cc3f1bc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion model.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,12 @@ def contents(self):
def title(self):
# forbid os.sep in the name, and replace it with '_',
# to prevent bugs when saving
return self.get_meta('title').replace(os.sep, '_')
title = self.get_meta('title').replace(os.sep, '_')
# Remove illegal characters from document title.
for illegalChar in ['/','~','#','&','*','\\','<','>','+','|','"','?',':']:
if illegalChar in title:
title=title.replace(illegalChar,'')
return title

@property
def is_owned(self):
Expand Down

0 comments on commit cc3f1bc

Please sign in to comment.