phpbb-seo / usu

Ultimate phpBB SEO Friendly URL extension
GNU General Public License v2.0
17 stars 12 forks source link

Login redirect from a virtual folder fails due to scriptname still being included in the URL #45

Open teebling opened 3 years ago

teebling commented 3 years ago

Describe the bug :
When you're on a viewforum page that has been rewritten by this ext, for example if you're in /off-topic/ instead of /viewforum.php?f=2, and you then click any link or submit any form to log in, the redirection after the successful login fails because it produces a URL that looks like this:

/viewforum.php/off-topic/?forum_uri=off-topic&start=&sid=...

The culprit is the 'viewforum.php' script name. If this were removed somehow then this bug would be fixed.

To Reproduce :
Steps to reproduce the behavior:

  1. Configure USU to use virtual forum folders in the ACP
  2. Refresh cache/update .htaccess as necessary
  3. Log out
  4. Navigate to any forum, for example /off-topic or /general-discussion
  5. Log in using quick login box or any standard log in link
  6. After successful log in, phpBB will try to redirect you to the page you were on previously, but it will fail, because of the viewforum.php scriptname in the URL that is generated.
  7. An error message 'The forum you selected does not exist.' is displayed.

Expected behavior :
What should happen is that you are redirected to /off-topic/?forum_uri=off-topic&start=&sid=..., NOT /viewforum.php/off-topic/?forum_uri=off-topic&start=&sid=....

Any chance we could get a quick find & replace fix for this?

teebling commented 3 years ago

Update: I believe it's semi-related to this issue https://www.phpbb.com/community/viewtopic.php?t=2107950 albeit in the 3.3 codebase (not 3.0) where phpBB doesn't recognise the virtual folder.

In the meantime I've made a very hacky fix with jQuery that changes the redirect hidden field to {FORUM_NAME} after passing it through .toLowerCase(), and this does the job for now.

meis2m commented 3 years ago

@Dark1z