completed
This commit is contained in:
27
get_mobileconfig.php
Normal file
27
get_mobileconfig.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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;
|
Reference in New Issue
Block a user