SimpleSAML_Auth_State::parseStateID PHP Method

parseStateID() public static method

Get the ID and (optionally) a URL embedded in a StateID, in the form 'id:url'.
Author: Andreas Solberg, UNINETT AS ([email protected])
Author: Jaime Perez, UNINETT AS ([email protected])
public static parseStateID ( string $stateId ) : array
$stateId string 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.
    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);
    }

Usage Example

Example #1
0
 /**
  * @deprecated This method will be removed in SSP 2.0. Please use SimpleSAML_Auth_State::parseStateID() instead.
  */
 public static function parseStateID($stateId)
 {
     return SimpleSAML_Auth_State::parseStateID($stateId);
 }