UUP dump API v1.17.0
- Updated attributes - Changed generation of UUIDs to create correct values - Added getting of cookie, so no longer there is need for starting cookie - Changed hard coded device value to randomly generated one
This commit is contained in:
@ -34,6 +34,23 @@ function randStr($length = 4) {
|
||||
return $randomString;
|
||||
}
|
||||
|
||||
function genUUID() {
|
||||
return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
|
||||
rand(0, 0xffff),
|
||||
rand(0, 0xffff),
|
||||
|
||||
rand(0, 0xffff),
|
||||
|
||||
rand(0, 0x0fff) | 0x4000,
|
||||
|
||||
rand(0, 0x3fff) | 0x8000,
|
||||
|
||||
rand(0, 0xffff),
|
||||
rand(0, 0xffff),
|
||||
rand(0, 0xffff)
|
||||
);
|
||||
}
|
||||
|
||||
function sendWuPostRequest($url, $postData) {
|
||||
$req = curl_init($url);
|
||||
|
||||
@ -52,7 +69,7 @@ function sendWuPostRequest($url, $postData) {
|
||||
curl_close($req);
|
||||
|
||||
$outDecoded = html_entity_decode($out);
|
||||
preg_match('/<NewCookie>.*?<\/NewCookie>/', $outDecoded, $cookieData);
|
||||
preg_match('/<NewCookie>.*?<\/NewCookie>|<GetCookieResult>.*?<\/GetCookieResult>/', $outDecoded, $cookieData);
|
||||
|
||||
if(!empty($cookieData)) {
|
||||
preg_match('/<Expiration>.*<\/Expiration>/', $cookieData[0], $expirationDate);
|
||||
|
Reference in New Issue
Block a user