Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/constants/PhabricatorCookies.php
Show First 20 Lines • Show All 158 Lines • ▼ Show 20 Lines | /* -( Next URI Cookie )---------------------------------------------------- */ | ||||
* @return list<string> List of timestamp and URI. | * @return list<string> List of timestamp and URI. | ||||
* | * | ||||
* @task next | * @task next | ||||
*/ | */ | ||||
private static function parseNextURICookie($cookie) { | private static function parseNextURICookie($cookie) { | ||||
// Old cookies look like: /uri | // Old cookies look like: /uri | ||||
// New cookies look like: timestamp,/uri | // New cookies look like: timestamp,/uri | ||||
if (!strlen($cookie)) { | if (!phutil_nonempty_string($cookie)) { | ||||
return null; | return null; | ||||
} | } | ||||
if (strpos($cookie, ',') !== false) { | if (strpos($cookie, ',') !== false) { | ||||
list($timestamp, $uri) = explode(',', $cookie, 2); | list($timestamp, $uri) = explode(',', $cookie, 2); | ||||
return array((int)$timestamp, $uri); | return array((int)$timestamp, $uri); | ||||
} | } | ||||
return array(0, $cookie); | return array(0, $cookie); | ||||
} | } | ||||
} | } |