Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
teebling opened this issue Mar 17, 2021 · 2 comments
Labels

Comments

@teebling
Copy link

teebling commented Mar 17, 2021

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 teebling added the bug label Mar 17, 2021
@teebling
Copy link
Author

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
Copy link
Member

meis2m commented Mar 22, 2021

@Dark1z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants