src/Core/WebSocket.php
public static function decodeToken($token) {
        global $CFG;
        $plain = AesCtr::decrypt($token, $CFG->websocket_secret, 256) ;
        $pieces = explode('::', $plain);
        if ( count($pieces) != 4 ) return false;
        return $plain;
    }
public static function decodeToken($token) {
        global $CFG;
        $plain = AesCtr::decrypt($token, $CFG->websocket_secret, 256) ;
        $pieces = explode('::', $plain);
        if ( count($pieces) != 4 ) return false;
        return $plain;
    }
public static function decodeToken ( $ token ) { global $ CFG ; $ plain = AesCtr :: decrypt ( $ token , $ CFG -> websocket_secret , 256 ) ; $ pieces = explode ( '::' , $ plain ) ; if ( count ( $ pieces ) != 4 ) return false ; return $ plain ; }
Decode and parse a token to make sure it is valid

@param string $token The encrypted token

@return string The plaintext token (or false on failure)
Decode and parse a token to make sure it is valid