function services_crossdomain_xml in Services 5
Same name and namespace in other branches
- 6 services.module \services_crossdomain_xml()
- 6.2 services.module \services_crossdomain_xml()
- 7 services.module \services_crossdomain_xml()
1 string reference to 'services_crossdomain_xml'
- services_menu in ./
services.module - Implementation of hook_menu.
File
- ./
services.module, line 263 - The module which provides the core code for drupal services
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);
}