← Back to team overview

anewt-developers team mailing list archive

[Branch ~uws/anewt/anewt.uws] Rev 1754: [core] Minor code cleanup in redirect() function

 

------------------------------------------------------------
revno: 1754
committer: Wouter Bolsterlee <uws@xxxxxxxxx>
branch nick: anewt.uws
timestamp: Tue 2010-02-16 00:59:34 +0100
message:
  [core] Minor code cleanup in redirect() function
modified:
  core/redirect.lib.php


--
lp:anewt
https://code.launchpad.net/~uws/anewt/anewt.uws

Your team Anewt developers is subscribed to branch lp:anewt.
To unsubscribe from this branch go to https://code.launchpad.net/~uws/anewt/anewt.uws/+edit-subscription.
=== modified file 'core/redirect.lib.php'
--- core/redirect.lib.php	2008-11-13 17:42:04 +0000
+++ core/redirect.lib.php	2010-02-15 23:59:34 +0000
@@ -44,9 +44,8 @@
 
 	/* Use the referring page (or the root url if not available) when the
 	 * special value -1 was specified */
-	if ($location === -1) {
-		$location = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/';
-	}
+	if ($location === -1)
+		$location = array_get_default($_SERVER, 'HTTP_REFERER', '/');
 
 	assert('is_string($location)');
 	assert('is_int($http_status)');