Files
ctdogetudid/get_mobileconfig.php
Do Nguyen 7eb61dcf9c completed
2025-06-04 22:46:55 +07:00

28 lines
809 B
PHP

<?php
// Clear any output buffers
while (ob_get_level()) ob_end_clean();
// Process the mobileconfig file
ob_start();
include('device.mobileconfig');
$config_content = ob_get_clean();
// Remove any BOM characters
$config_content = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $config_content);
// Ensure proper XML formatting
if (strpos($config_content, '<?xml') !== 0) {
$config_content = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . $config_content;
}
// Set strict headers
header('Content-Type: application/x-apple-aspen-config');
header('Content-Disposition: attachment; filename="udid.mobileconfig"');
header('Content-Length: ' . strlen($config_content));
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
// Output the configuration
echo $config_content;
exit;