#522 [Opn->Csd]: login doesn't bring you back to page the you came from

From: Date: Mon, 05 Jan 2004 20:02:43 +0000
Subject: #522 [Opn->Csd]: login doesn't bring you back to page the you came from
References: 1  Groups: php.pear.webmaster 
Request: Send a blank email to pear-webmaster+get-1176@lists.php.net to get a copy of this message
ID: 522 Updated by: mj@php.net Reported By: danielc at analysisandsolutions dot com -Status: Open +Status: Closed Bug Type: Web Site Operating System: Irrelevant PHP Version: Irrelevant New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [2004-01-05 10:55:06] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=522&edit=1

« previous php.pear.webmaster (#1176) next »