function services_crossdomain_xml in Services 6
Same name and namespace in other branches
- 5 services.module \services_crossdomain_xml()
- 6.2 services.module \services_crossdomain_xml()
- 7 services.module \services_crossdomain_xml()
Callback for crossdomain.xml
1 string reference to 'services_crossdomain_xml'
- services_menu in ./
services.module - Implementation of hook_menu().
File
- ./
services.module, line 188 - @author Services Dev Team
Code
function services_crossdomain_xml() {
global $base_url;
$output = '<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">' . "\n";
$output .= '<cross-domain-policy>' . "\n";
$output .= ' <allow-access-from domain="' . check_plain($_SERVER['HTTP_HOST']) . '" />' . "\n";
$output .= ' <allow-access-from domain="*.' . check_plain($_SERVER['HTTP_HOST']) . '" />' . "\n";
$keys = services_get_keys();
foreach ($keys as $key) {
if (!empty($key->domain)) {
$output .= ' <allow-access-from domain="' . check_plain($key->domain) . '" />' . "\n";
$output .= ' <allow-access-from domain="*.' . check_plain($key->domain) . '" />' . "\n";
}
}
$output .= '</cross-domain-policy>';
services_xml_output($output);
}