<?xml version="1.0"?>
<!--
/**
 * Copyright (c) IDDQD Ltd
 *
 * Dependency Injection Configuration
 *
 * This file configures plugins to sanitize address data and prevent XSS attacks
 * in checkout and address management forms.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!-- Plugin to sanitize quote address data (checkout) -->
    <type name="Magento\Quote\Model\Quote\Address">
        <plugin name="idealpostcodes_sanitize_quote_address" 
                type="Idealpostcodes\Ukaddresssearch\Plugin\Quote\SanitizeAddressPlugin" 
                sortOrder="10"/>
    </type>
    
    <!-- Plugin to sanitize customer address data -->
    <type name="Magento\Customer\Model\Address">
        <plugin name="idealpostcodes_sanitize_customer_address" 
                type="Idealpostcodes\Ukaddresssearch\Plugin\Customer\SanitizeAddressPlugin" 
                sortOrder="10"/>
    </type>
</config>
