Check if url starts with subreddit path before adding.

Fixes add_sr behavior for multi URLs.
This commit is contained in:
Max Goodman
2013-03-09 01:20:52 -08:00
parent 386e6dda39
commit 3f5b26bb48

View File

@@ -574,7 +574,8 @@ class UrlParser(object):
Adds the subreddit's path to the path if another subreddit's
prefix is not already present.
"""
if not self.path_has_subreddit():
if not (self.path_has_subreddit()
or self.path.startswith(subreddit.path)):
self.path = (subreddit.path + self.path)
return self