#522 [NEW]: login doesn't bring you back to page the you came from
| From: | danielc at analysisandsolutions dot com | Date: | Mon, 05 Jan 2004 15:55:06 +0000 |
| Subject: | #522 [NEW]: login doesn't bring you back to page the you came from | ||
| Groups: | php.pear.webmaster | ||
| Request: | Send a blank email to pear-webmaster+get-1173@lists.php.net to get a copy of this message | ||
From: danielc at analysisandsolutions dot com
Operating system: Irrelevant
PHP version: Irrelevant
PHP Bug Type: Web Site
Bug description: login doesn't bring you back to page the you came from
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.
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=522&edit=1
--