Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
fix(agent): fixed XML inventory request, it must be on base64
Browse files Browse the repository at this point in the history
  • Loading branch information
DIOHz0r authored and btry committed Jan 18, 2018
1 parent 8f6b5d9 commit 31018f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion inc/agent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,8 @@ protected function enrollByInvitationToken($input) {
$lastname = isset($input['lastname']) ? $input['lastname'] : null;
$version = isset($input['version']) ? $input['version'] : null;
$mdmType = isset($input['type']) ? $input['type'] : null;
$inventory = isset($input['inventory']) ? htmlspecialchars_decode($input['inventory'], ENT_XML1) : null;
$inventory = isset($input['inventory']) ? htmlspecialchars_decode(base64_decode($input['inventory']),
ENT_COMPAT | ENT_XML1) : null;
$systemPermission = isset($input['has_system_permission']) ? $input['has_system_permission'] : 0;
// For non-android agents, system permssion might be forced to 1 depending on the lack of such cosntraint

Expand Down
2 changes: 1 addition & 1 deletion tests/src/TestingCommonTools.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,6 @@ public static function AgentXmlInventory($serial, $macAddress = '', $deviceId =
</BATTERIES>
</CONTENT>
</REQUEST>";
return htmlspecialchars($xml);
return base64_encode($xml);
}
}

0 comments on commit 31018f9

Please sign in to comment.