]> git.mxchange.org Git - core.git/blobdiff - framework/bootstrap/class_FrameworkBootstrap.php
Continued:
[core.git] / framework / bootstrap / class_FrameworkBootstrap.php
index 26c419daf0dc42f1a124627a896c3e919e968338..c8141169428e144df086ccd36d49b4a01fcee8e4 100644 (file)
@@ -29,7 +29,7 @@ use \SplFileInfo;
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2019 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.ship-simu.org
  *
@@ -237,6 +237,7 @@ final class FrameworkBootstrap {
                // Load basic include files to continue bootstrapping
                self::loadInclude(new SplFileInfo(sprintf('%smain%sinterfaces%sclass_FrameworkInterface.php', ApplicationEntryPoint::detectFrameworkPath(), DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)));
                self::loadInclude(new SplFileInfo(sprintf('%smain%sclasses%sclass_BaseFrameworkSystem.php', ApplicationEntryPoint::detectFrameworkPath(), DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)));
+               self::loadInclude(new SplFileInfo(sprintf('%smain%sclasses%sutils%sclass_StringUtils.php', ApplicationEntryPoint::detectFrameworkPath(), DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)));
                self::loadInclude(new SplFileInfo(sprintf('%smain%sinterfaces%sregistry%sclass_Registerable.php', ApplicationEntryPoint::detectFrameworkPath(), DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR)));
                self::loadInclude(new SplFileInfo(sprintf('%sconfig%sclass_FrameworkConfiguration.php', ApplicationEntryPoint::detectFrameworkPath(), DIRECTORY_SEPARATOR)));
 
@@ -362,9 +363,6 @@ final class FrameworkBootstrap {
                        ));
                }
 
-               // Set it in registry
-               GenericRegistry::getRegistry()->addInstance('application', $applicationInstance);
-
                // Now call all methods in one go
                foreach (array('setupApplicationData', 'initApplication', 'launchApplication') as $methodName) {
                        // Debug message
@@ -480,7 +478,21 @@ final class FrameworkBootstrap {
         * @todo        Test more fields
         */
        public static function isHttpSecured () {
-               return (isset($_SERVER['HTTPS']));
+               return (
+                       (
+                               (
+                                       isset($_SERVER['HTTPS'])
+                               ) && (
+                                       strtolower($_SERVER['HTTPS']) == 'on'
+                               )
+                       ) || (
+                               (
+                                       isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
+                               ) && (
+                                       strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https'
+                               )
+                       )
+               );
        }
 
        /**
@@ -495,7 +507,7 @@ final class FrameworkBootstrap {
                // Do we have HTTPS?
                if (self::isHttpSecured()) {
                        // Add the >s< for HTTPS
-                       $protocol = 's';
+                       $protocol = 'https';
                } // END - if
 
                // Construct the full URL and secure it against CSRF attacks