/** * Fills the order address object with the values from the array. * * @param \Aimeos\MShop\Order\Item\Base\Address\Iface $address Address item to store the values into * @param array $map Associative array of key/value pairs. The keys must be the same as when calling toArray() from * an address item. * @throws \Aimeos\Controller\Frontend\Basket\Exception */ protected function setAddressFromArray(\Aimeos\MShop\Order\Item\Base\Address\Iface $address, array $map) { foreach ($map as $key => $value) { $map[$key] = strip_tags($value); // prevent XSS } $errors = $address->fromArray($map); if (count($errors) > 0) { $msg = sprintf('Invalid address properties, please check your input'); throw new \Aimeos\Controller\Frontend\Basket\Exception($msg, 0, null, $errors); } }