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

Commit

Permalink
fix(policy): ensure path to file ends with a slash when creating a fi…
Browse files Browse the repository at this point in the history
…le removal policy
  • Loading branch information
btry committed May 26, 2017
1 parent ad1074f commit b6018dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inc/policydeployfile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ public function unapply(PluginFlyvemdmFleet $fleet, $value, $itemtype, $itemId)
}

$fleet_policy = new PluginFlyvemdmFleet_Policy();
// Ensure there is a trailing slash
if (strrpos($decodedValue['destination'], '/') != strlen($decodedValue['destination']) - 1) {
$decodedValue['destination'] .= '/';
}

if (!$fleet_policy->add([
'plugin_flyvemdm_fleets_id' => $fleet->getID(),
'plugin_flyvemdm_policies_id' => $policyData->getID(),
Expand Down

0 comments on commit b6018dd

Please sign in to comment.