php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55947 login doesn't bring you back to page the you came from
Submitted: 2004-01-05 10:55 UTC Modified: 2004-01-05 15:02 UTC
From: danielc at analysisandsolutions dot com Assigned: mj (profile)
Status: Closed Package: PECL website (PECL)
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: danielc at analysisandsolutions dot com
New email:
PHP Version: OS:

 

 [2004-01-05 10:55 UTC] danielc at analysisandsolutions dot com
Description:
------------
I notice that logging in doesn't bring one back to the page they initially clicked the "Login" link from.  I assume that's the intention of the following code:

        print '<input type="hidden" name="PEAR_OLDURL" value="';
        if (basename($_SERVER['PHP_SELF']) == 'login.php') {
            print '/';
        } elseif (isset($_POST['PEAR_OLDURL'])) {
            print htmlspecialchars($_POST['PEAR_OLDURL']);
        } else {
            print htmlspecialchars($_SERVER['REQUEST_URI']);
        }
        print "\" />\n";

Quickly glancing at that makes it look like that wouldn't do the trick since PHP_SELF will be login.php in most cases, so "/" will be used and PEAR_OLDURL will never be gotten to.  Perhaps this will do the trick?

        print '<input type="hidden" name="PEAR_OLDURL" value="';
        if (isset($_POST['PEAR_OLDURL'])) {
            print htmlspecialchars($_POST['PEAR_OLDURL']);
        } elseif (isset($_SERVER['REQUEST_URI']) {
            print htmlspecialchars($_SERVER['REQUEST_URI']);
        } else {
            print '/';
        }
        print "\" />\n";

Thanks.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-05 15:02 UTC] mj@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pear.php.net.

In case this was a pear.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PEAR better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jan 25 23:01:30 2025 UTC