The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
double slash on login page redirect
#1
Sorry if this isn't the right place to post but when I click on the bugs forum I'm getting an error 500 from your page.

So I created an override to login.php in the usersc folder, and its contents are:

require_once '../users/init.php';
Redirect::to('../dashboard/login.php');

And it indeed works, and redirects normally and the login form works well, except that I'm getting a double slash on the url:
http://example.com//dashboard/login.php

And when I login I get a triple slash:
http://example.com///users/account.php

Anyway we can fix this?
  Reply
#2
Forgot to mention I'm using version 4.1.7b
  Reply
#3
I just realized I wasn't using the latest version (the exact version number isn't mentioned on the homepage) and I updated.
I'm using now Version 4.1.8b

However, now I'm getting three slashes when I get redirected to /dashboard/login.php

http://example.com///dashboard/login.php

and two slashes when I login:

http://example.com//users/account.php
  Reply
#4
Let me take a look at that. There were several changes to redirect and login functions lately. I will try to get out a fix this week.

Btw, when you upgraded to 4.1.8b did you do the full upgrade (including the usersc folder)... That is where the first fix was for this problem.
  Reply
#5
When I did the upgrade, I downloaded this:

https://userspice.org/patch/417bto418b.zip

and I extracted & overwritten everything in my server folders.
  Reply
#6
My update went fine. Could it be the / you have in your login script prior to the remainder of the URL? Try removing that and see what that does for ya.
  Reply
#7
I was having the same problem with double slashes (//) and then a comment introduced in 4.1.8b helped me fix it. In you usersc\scripts\custom_login_script.php file it mentions that the Redirect path is relative from userc/scripts thus they added ../../ before the actual redirect to destination. I was using Redirect::to($us_url_root.'folder/home.php'); so I changed that to Redirect::to('../../'.'folder/home.php'); and now double slashes are gone.
  Reply
#8
Ok here's how I fixed it. In my usersc/login.php override,

Instead of:
require_once ‘../users/init.php’;
Redirect::to(‘../dashboard/login.php’);

I put:
require_once '../users/init.php';
$root = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';
Redirect::to($root.'dashboard/login.php');


Props to @venedude for helping me understand what's going on.
  Reply
#9
Yep...great work. The original problem was that people were updating our core code to change where people login and then would lose those changes when they updated. This is a fix for that, but it reacts slightly differently on different servers, so we need to keep working out some kinks.
  Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)