|  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
 [2004-01-05 10:55 UTC] danielc at analysisandsolutions dot com
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";



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-05 15:02 UTC]
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

In case this was a 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-2024 The PHP Group
All rights reserved.
Last updated: Thu Jun 20 10:01:31 2024 UTC