Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, October 14, 2026

Diff for phpPlatonLib/Platon/Platon.php between version 1.26 and 1.27

version 1.26, 2004/12/12 21:50:18 version 1.27, 2004/12/13 10:23:54
Line 24 
Line 24 
  * @access      public   * @access      public
  */   */
   
 /* $Platon: phpPlatonLib/Platon/Platon.php,v 1.25 2004/12/12 21:44:55 nepto Exp $ */  /* $Platon: phpPlatonLib/Platon/Platon.php,v 1.26 2004/12/12 21:50:18 nepto Exp $ */
   
 class Platon  class Platon
 {  {
Line 183  class Platon
Line 183  class Platon
         }          }
         exit;          exit;
     } /* }}} */      } /* }}} */
   
       /**
        * Changes a HTTP host using permanent redirect
        *
        * @param   string  $new_http_host  destination HTTP host
        * @param   string  $old_http_host  source HTTP host (string or array)
        *                                  empty string means any host
        */
       function redirect_change_host($new_http_host, $old_http_host = '') /* {{{ */
       {
           if (strlen($_SERVER['HTTP_HOST']) <= 0) {
               return;
           }
           if (! strcasecmp($new_http_host, $_SERVER['HTTP_HOST'])) {
               return;
           }
           if (is_array($old_http_host)) {
               foreach ($old_http_host as $http_host) {
                   Platon::redirect_change_host($new_http_host, $old_http_host);
               }
               return;
           }
           if (strlen($old_http_host) > 0) {
               if (strcasecmp($old_http_host, $_SERVER['HTTP_HOST'])) {
                   return;
               }
           }
           $schema = strcasecmp($_SERVER['HTTPS'], 'on') ? 'http' : 'https';
           $request_uri = $_SERVER['REQUEST_URI'];
           return Platon::redirect("$schema://$new_http_host$request_uri");
       } /* }}} */
   
     /**      /**
      * Redirects if it is neccessary for particular file.       * Redirects if it is neccessary for particular file.

Legend:
Removed from v.1.26  
changed lines
  Added in v.1.27

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top