vyznev / soup

Stack Overflow Unofficial Patch
27 stars 6 forks source link

Request for new fix for pagination links for spam-deleted posts #43

Closed gparyani closed 5 years ago

gparyani commented 5 years ago

I recently encountered a bug when viewing a post with multiple pages of answers that a moderator had locked and deleted, which had helpful spam or rude/abusive flags.

When trying to navigate to a subsequent page of answers using the pagination link, or when trying to access a specific answer that happens to be on a page other than the first page, the server-side logic that automatically removes the question title from the URL (to prevent it from being exploited by spammers) also causes things like ?page=2 to be stripped out, making it impossible to view a subsequent page unless I manually modify the URL to remove the question title while leaving the query parameter intact.

I've posted a detailed answer showing the cause of the bug and the workaround.

It would be nice to have the fix in SOUP. I think it's reasonable because all that needs to be done is remove the question title from the pagination links for deleted posts. (The "Return to Answer" links may not be fixable, but still.)

gparyani commented 5 years ago

@vyznev Is this being considered?

vyznev commented 5 years ago

As you may have noticed, I haven't had much time for SOUP development lately. I'd be happy to accept any contributions, but writing new fixes from scratch takes time that I often don't really have.

That said, since you reminded me of this, I decided to take a look into this issue, and it turns out to be fairly easy to work around. So, here you go. The fix is already in the development branch of SOUP, and will be in the next stable release. :)

(And no, it doesn't fix the "return to answer" links from revision history. Doing that would indeed be trickier, since there's no indication on the revision history page itself that the question has been deleted as spam or offensive.)