Skip to content
Snippets Groups Projects
Commit 78cf59db authored by Jaime Perez Crespo's avatar Jaime Perez Crespo
Browse files

Move SimpleSAML_Utilities::parseStateID() to...

Move SimpleSAML_Utilities::parseStateID() to SimpleSAML_Auth_State::parseStateID() and deprecate the former.
parent 8131ccaf
No related branches found
No related tags found
No related merge requests found
......@@ -302,7 +302,7 @@ class SimpleSAML_Auth_ProcessingChain {
* Retrieve a state which has finished processing.
*
* @param string $id The state identifier.
* @see SimpleSAML_Utilities::parseStateID()
* @see SimpleSAML_Auth_State::parseStateID()
* @return Array The state referenced by the $id parameter.
*/
public static function fetchProcessedState($id) {
......
......@@ -210,7 +210,7 @@ class SimpleSAML_Auth_State {
assert('is_bool($allowMissing)');
SimpleSAML_Logger::debug('Loading state: ' . var_export($id, TRUE));
$sid = SimpleSAML_Utilities::parseStateID($id);
$sid = self::parseStateID($id);
$session = SimpleSAML_Session::getSessionFromRequest();
$state = $session->getData('SimpleSAML_Auth_State', $sid['id']);
......@@ -337,4 +337,26 @@ class SimpleSAML_Auth_State {
return $state;
}
/**
* Get the ID and (optionally) a URL embedded in a StateID, in the form 'id:url'.
*
* @param string $stateId The state ID to use.
*
* @return array A hashed array with the ID and the URL (if any), in the 'id' and 'url' keys, respectively. If
* there's no URL in the input parameter, NULL will be returned as the value for the 'url' key.
*
* @author Andreas Solberg, UNINETT AS <andreas.solberg@uninett.no>
* @author Jaime Perez, UNINETT AS <jaime.perez@uninett.no>
*/
public static function parseStateID($stateId) {
$tmp = explode(':', $stateId, 2);
$id = $tmp[0];
$url = null;
if (count($tmp) === 2) {
$url = $tmp[1];
}
return array('id' => $id, 'url' => $url);
}
}
......@@ -110,23 +110,10 @@ class SimpleSAML_Utilities {
/**
* Get the ID and (optionally) a URL embedded in a StateID,
* in the form 'id:url'.
*
* @param string $stateId The state ID to use.
* @return array A hashed array with the ID and the URL (if any),
* in the 'id' and 'url' keys, respectively. If there's no URL
* in the input parameter, NULL will be returned as the value for
* the 'url' key.
* @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML_Auth_State::parseStateID() instead.
*/
public static function parseStateID($stateId) {
$tmp = explode(':', $stateId, 2);
$id = $tmp[0];
$url = NULL;
if (count($tmp) === 2) {
$url = $tmp[1];
}
return array('id' => $id, 'url' => $url);
return SimpleSAML_Auth_State::parseStateID($stateId);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment