News:

Please note these forums are mostly a testing ground for my SMF work and I don't really use them otherwise.

Main Menu

Paste-1277339219:v:use_geshi-1:v:type-php

Started by SleePy, Jun 24, 2010, 12:26 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

SleePy

<?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;
}

?>
No siggy! :D

SleePy

<?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;
}

?>
No siggy! :D