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

Diff for phpPlatonLib/Platon/Platon.php between version 1.1 and 1.2

version 1.1, 2002/11/26 15:56:42 version 1.2, 2002/11/27 22:25:39
Line 188  class Platon
Line 188  class Platon
          */           */
         function redirect_test($file, $url) /* {{{ */          function redirect_test($file, $url) /* {{{ */
         {          {
                 global $PHP_SELF;          global $HTTP_SERVER_VARS;
                 if (eregi($file, $PHP_SELF)) {          if (! isset($HTTP_SERVER_VARS['PHP_SELF'])
                         return true;                  || ! eregi($file, $HTTP_SERVER_VARS['PHP_SELF'])) {
                 }              return true;
                 if (strlen($url) <= 0)          }
                         die('empty $url in redirect_test()');          if (strlen($url) <= 0) {
               die('empty $url in redirect_test()');
           }
                 $schema = '';                  $schema = '';
                 if (strncmp($url, "http://", 7)) {                  if (strncmp($url, "http://", 7)) {
                         $schema = 'http';                          $schema = 'http';
                 } elseif (strncmp($url, "https://", 8)) {                  } elseif (strncmp($url, "https://", 8)) {
                         $schema = 'https';                          $schema = 'https';
                 }                  }
   
                 global $HTTP_HOST;  
                 global $SERVER_NAME;  
                 if (strlen($schema) > 0) {                  if (strlen($schema) > 0) {
                         // TODO: create delim according to $SCRIPT_NAME                          // TODO: create delim according to $HTTP_SERVER_VARS['SCRIPT_NAME']
                         $delim = $url[0] == '/' ? '' : '/';                          $delim       = $url[0] == '/' ? '' : '/';
               $http_host   = @$HTTP_SERVER_VARS['HTTP_HOST'];
               $server_name = @$HTTP_SERVER_VARS['SERVER_NAME'];
   
                         if (isset($HTTP_HOST)                          if (isset($http_host)
                                         && is_string($HTTP_HOST)                                          && is_string($http_host)
                                         && strlen($HTTP_HOST) > 0) {                                          && strlen($http_host) > 0) {
                                 $url = "$schema://$HTTP_HOST$delim$url";                                  $url = "$schema://$http_host$delim$url";
                         }                          } elseif (isset($server_name)
                         elseif (isset($SERVER_NAME)                                          && is_string($server_name)
                                         && is_string($SERVER_NAME)                                          && strlen($server_name) > 0) {
                                         && strlen($SERVER_NAME) > 0) {                                  $url = "$schema://$server_name$delim$url";
                                 $url = "$schema://$SERVER_NAME$delim$url";  
                         }                          }
                 }                  }
           //echo("Location: $url [$file][".$HTTP_SERVER_VARS['PHP_SELF']."]");
                 header("Location: $url");                  header("Location: $url");
                 die();          exit;
         } /* }}} */          } /* }}} */
   
         /** common/misc/fnc.write_origvars_html.php - creates HTML hidden          /** common/misc/fnc.write_origvars_html.php - creates HTML hidden

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

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