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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
39 - 18 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 02:01:29 2024 UTC