Skip to content

Commit

Permalink
Make sure we don't accidentally delete our download directory.
Browse files Browse the repository at this point in the history
  • Loading branch information
Irexistus committed Oct 26, 2013
1 parent 6175925 commit a2be86b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/ajaxPage.py
Expand Up @@ -454,7 +454,8 @@ def delete_torrent(self, torrent_id):
files = self.RT.getFiles(torrent_id)
if len(files) == 1:
#single file
if files[0].base_path == self.RT.getRootDir():
rootDir = os.path.abspath(os.path.expanduser(os.path.expandvars(self.RT.getRootDir())))
if files[0].base_path == rootDir:
delete = files[0].abs_path
else:
delete = files[0].base_path
Expand Down Expand Up @@ -655,4 +656,4 @@ def moveTracker(self, url, target_alias):
except:
print(traceback.print_exc())
return "NO"


0 comments on commit a2be86b

Please sign in to comment.