cvs: pearweb /public_html/error 404.php
| From: | David Coallier | Date: | Fri, 06 Jul 2007 19:08:15 +0000 |
| Subject: | cvs: pearweb /public_html/error 404.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-cvs+get-47888@lists.php.net to get a copy of this message | ||
davidc Fri Jul 6 19:08:15 2007 UTC
Modified files:
/pearweb/public_html/error 404.php
Log:
- Added a $redirect url from patch from till (http://pear.php.net/user/till)
http://cvs.php.net/viewvc.cgi/pearweb/public_html/error/404.php?r1=1.27&r2=1.28&diff_format=u
Index: pearweb/public_html/error/404.php
diff -u pearweb/public_html/error/404.php:1.27 pearweb/public_html/error/404.php:1.28
--- pearweb/public_html/error/404.php:1.27 Sun Apr 22 01:51:36 2007
+++ pearweb/public_html/error/404.php Fri Jul 6 19:08:14 2007
@@ -15,7 +15,7 @@
+----------------------------------------------------------------------+
| Authors: |
+----------------------------------------------------------------------+
- $Id: 404.php,v 1.27 2007/04/22 01:51:36 dufuz Exp $
+ $Id: 404.php,v 1.28 2007/07/06 19:08:14 davidc Exp $
*/
/**
@@ -29,15 +29,22 @@
* Requesting something like /~foobar will redirect to the account
* information page of the user "foobar".
*/
-if (strlen($_SERVER['REDIRECT_URL']) > 0 &&
$_SERVER['REDIRECT_URL']{1} == '~') {
- $user = substr($_SERVER['REDIRECT_URL'], 2);
+$_redirect_url = '';
+$_redirect_url .= isset($_SERVER['REDIRECT_URL']) ? $_SERVER['REDIRECT_URL'] :
'';
+
+if (empty($_redirect_url)) {
+ $_redirect_url .= isset($_SERVER['REDIRECT_URI']) ?
$_SERVER['REDIRECT_URI'] : '';
+}
+
+if (strlen($_redirect_url) > 0 && $_redirect_url{1} == '~') {
+ $user = substr($_redirect_url, 2);
include_once 'pear-database-user.php';
if (preg_match(PEAR_COMMON_USER_NAME_REGEX, $user) && user::exists($user)) {
localRedirect("/user/" . urlencode($user));
}
}
-$pkg = strtr($_SERVER['REDIRECT_URL'], '-','_');
+$pkg = strtr($_redirect_url, '-','_');
$pkg = htmlentities($pkg);
$pinfo_url = '/package/';