<?php
// We just start, and we are already preparing to shutdown.
// !!! This file is called via php_admin_value auto_prepend_file
register_shutdown_function('sm_shutdown_function');
// The fun never ends.
function sm_shutdown_function()
{
// Make a clean getaway.
$contents = ob_get_contents();
ob_clean();
// Inject something and act like nothing happened.
$contents = str_replace('*****', '*****', $contents);
echo $contents;
exit;
}
?>
<?php
// We just start, and we are already preparing to shutdown.
// !!! This file is called via php_admin_value auto_prepend_file
register_shutdown_function('sm_shutdown_function');
// The fun never ends.
function sm_shutdown_function()
{
// Make a clean getaway.
$contents = ob_get_contents();
ob_clean();
// First we find out if we are going to be redirecting and fix that.
$headers = headers_list();
foreach ($headers as $key => $value)
{
if (strpos($value, 'Location:') === false)
continue;
header('Location:' . strtr($value, array(
'mydomain.com' => 'foobar.test',
)));
}
// Inject something and act like nothing happened.
$contents = str_replace('mydomain.com', 'foobar.test', $contents);
echo $contents;
exit;
}
?>