mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 16:28:01 -05:00
Check if url starts with subreddit path before adding.
Fixes add_sr behavior for multi URLs.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user