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

Diff for Metafox/lib/Platon.php between version 1.14 and 1.15

version 1.14, 2026/11/06 11:37:07 version 1.15, 2026/11/06 14:16:37
Line 25 
Line 25 
  * @access      public   * @access      public
  */   */
   
 /* $Platon: phpPlatonLib/Platon/Platon.php,v 1.44 2026/11/06 11:34:53 nepto Exp $ */  /* $Platon: phpPlatonLib/Platon/Platon.php,v 1.46 2026/11/06 14:11:54 nepto Exp $ */
   
 class Platon  class Platon
 {  {
Line 168  class Platon
Line 168  class Platon
                 || ! strncmp($where, "https://", 8)) {                  || ! strncmp($where, "https://", 8)) {
             $url = $where;              $url = $where;
         } else {          } else {
             $url         = "http://";              $https       = ! empty($_SERVER['HTTPS'])
                   && strtolower($_SERVER['HTTPS']) != 'off';
               $url         = $https ? 'https://' : 'http://';
             $http_host   = @$_SERVER['HTTP_HOST'];              $http_host   = @$_SERVER['HTTP_HOST'];
             $server_name = @$_SERVER['SERVER_NAME'];              $server_name = @$_SERVER['SERVER_NAME'];
   
Line 227  class Platon
Line 229  class Platon
                 return;                  return;
             }              }
         }          }
         $schema = strcasecmp($_SERVER['HTTPS'], 'on') ? 'http' : 'https';          $https  = ! empty($_SERVER['HTTPS'])
               && strtolower($_SERVER['HTTPS']) != 'off';
           $schema = $https ? 'https' : 'http';
         $request_uri = $_SERVER['REQUEST_URI'];          $request_uri = $_SERVER['REQUEST_URI'];
         return Platon::redirect("$schema://$new_http_host$request_uri");          return Platon::redirect("$schema://$new_http_host$request_uri");
     } /* }}} */      } /* }}} */
Line 247  class Platon
Line 251  class Platon
             }              }
             return true;              return true;
         }          }
         if (! isset($_SERVER['PHP_SELF'])          // PHP_SELF contains PATH_INFO, so /cvs.php/x/db.inc.php would match
                 || stripos($_SERVER['PHP_SELF'], $file) === false ) {          if (! isset($_SERVER['SCRIPT_NAME'])
                   || strcasecmp(basename($_SERVER['SCRIPT_NAME']), $file)) {
             return true;              return true;
         }          }
         if (strlen($url) <= 0) {          if (strlen($url) <= 0) {
             trigger_error('empty input parameter $url'              trigger_error('empty input parameter $url'
                     .' in Platon::redirect_test()'.$method, E_USER_ERROR);                      .' in Platon::redirect_test()', E_USER_ERROR);
             return;              return;
         }          }
           $https  = ! empty($_SERVER['HTTPS'])
               && strtolower($_SERVER['HTTPS']) != 'off';
         $schema = '';          $schema = '';
         if (strncmp($url, "http://", 7)) {          if (strncmp($url, 'http://', 7) != 0
             $schema = 'http';                  && strncmp($url, 'https://', 8) != 0) {
         } elseif (strncmp($url, "https://", 8)) {              $schema = $https ? 'https' : 'http';
             $schema = 'https';  
         }          }
         if (strlen($schema) > 0) {          if (strlen($schema) > 0) {
             // TODO: create delim according to $_SERVER['SCRIPT_NAME']              // TODO: create delim according to $_SERVER['SCRIPT_NAME']

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

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