From fd1a3dcb808fcdf6db019c2dc60d36dd2f103b49 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Wed, 29 Jan 2020 15:30:35 -0400 Subject: [PATCH] PMCORE-1034 ProcessMaker is not running in Stack 270 --- gulliver/system/class.bootstrap.php | 2 +- tests/bootstrap.php | 1 + tests/unit/gulliver/system/BootstrapTest.php | 65 ++++++++++++++++++++ workflow/public_html/sysGeneric.php | 8 ++- 4 files changed, 72 insertions(+), 4 deletions(-) create mode 100644 tests/unit/gulliver/system/BootstrapTest.php diff --git a/gulliver/system/class.bootstrap.php b/gulliver/system/class.bootstrap.php index 7d72ba10a..cf052e2b4 100644 --- a/gulliver/system/class.bootstrap.php +++ b/gulliver/system/class.bootstrap.php @@ -944,7 +944,7 @@ class Bootstrap } //Remove comments.. - $regex = array("`^([\t\s]+)`ism" => '', "`^\/\*(.+?)\*\/`ism" => "", "`([\n\A;]+)\/\*(.+?)\*\/`ism" => "$1", "`([\n\A;\s]+)//(.+?)[\n\r]`ism" => "$1\n", "`(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+`ism" => "\n"); + $regex = array("`^([\t\s]+)`ism" => '', "`^\/\*(.+?)\*\/`ism" => "", "`([\n;]+)\/\*(.+?)\*\/`ism" => "$1", "`([\n;\s]+)//(.+?)[\n\r]`ism" => "$1\n", "`(^[\r\n]*|[\r\n]+)[\s\t]*[\r\n]+`ism" => "\n"); $output = preg_replace(array_keys($regex), $regex, $output); $output = $outputHeader . $output; diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 8b22f86b5..c31a18f13 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -77,6 +77,7 @@ define("PATH_DYNAFORM", PATH_DATA_SITE . "xmlForms/"); define("PATH_DATA_MAILTEMPLATES", PATH_DATA_SITE . "mailTemplates/"); define("PATH_DATA_PUBLIC", PATH_DATA_SITE . "public/"); define("PATH_CONTROLLERS", PATH_CORE . "controllers" . PATH_SEP); +define("PATH_SKIN_ENGINE", PATH_CORE . "skinEngine" . PATH_SEP); G::defineConstants(); /** diff --git a/tests/unit/gulliver/system/BootstrapTest.php b/tests/unit/gulliver/system/BootstrapTest.php new file mode 100644 index 000000000..da434bfc1 --- /dev/null +++ b/tests/unit/gulliver/system/BootstrapTest.php @@ -0,0 +1,65 @@ +faker = Factory::create(); + } + + /** + * This tests if the content of the css files is being generated correctly. + * @test + * @covers \Bootstrap::streamCSSBigFile() + */ + public function it_should_test_the_generation_of_css_files() + { + $userAgent = $this->faker->userAgent; + $_SERVER ['HTTP_USER_AGENT'] = $userAgent; + $filename = "neoclassic"; + $result = Bootstrap::streamCSSBigFile($filename); + + //add more assertions + $this->assertRegexp("/{$filename}/", $result); + $this->assertRegexp("/font-face/", $result); + $this->assertRegexp("/font-family/", $result); + + $filename = "jscolors"; + $result = Bootstrap::streamCSSBigFile($filename); + + //add more assertions + $this->assertRegexp("/{$filename}/", $result); + + $filename = "xmlcolors"; + $result = Bootstrap::streamCSSBigFile($filename); + + //add more assertions + $this->assertRegexp("/{$filename}/", $result); + + $filename = "classic"; + $result = Bootstrap::streamCSSBigFile($filename); + + //add more assertions + $this->assertRegexp("/{$filename}/", $result); + $this->assertRegexp("/font-family/", $result); + $this->assertRegexp("/ss_group_suit/", $result); + + $filename = "classic-extjs"; + $result = Bootstrap::streamCSSBigFile($filename); + + //add more assertions + $this->assertRegexp("/{$filename}/", $result); + } +} diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index ad4359f13..d59a80364 100644 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -296,12 +296,14 @@ if ((preg_match("/msie/i", $_SERVER ['HTTP_USER_AGENT']) != 1 || $config['safari_cookie_lifetime'] == 1)) { ini_set('session.cookie_lifetime', $timelife); } -session_start(); -if (!(array_key_exists('REMOTE_USER', $_SERVER) && (string)($_SERVER['REMOTE_USER']) != '')) { +if (!(array_key_exists('REMOTE_USER', $_SERVER) && (string) ($_SERVER['REMOTE_USER']) != '')) { ini_set('session.cookie_httponly', 1); - ini_set('session.cookie_secure', 1); + if (G::is_https()) { + ini_set('session.cookie_secure', 1); + } } +session_start(); //Set Time Zone /*----------------------------------********---------------------------------*/