From 41eb7b2f9ae2b58243b087dfccb2262e25abb474 Mon Sep 17 00:00:00 2001 From: "Marco A. Nina Mena" Date: Thu, 23 Feb 2017 15:14:44 -0400 Subject: [PATCH] HOR-2773 we need to use G::is_https() for get the protocol change to use G::is_https() --- gulliver/methods/errors/block.php | 2 +- gulliver/methods/errors/error403.php | 2 +- workflow/engine/classes/class.enterpriseUtils.php | 2 +- workflow/engine/classes/model/OutputDocument.php | 2 +- workflow/engine/content/languages/en.js | 0 workflow/engine/content/languages/translation.en | 0 workflow/engine/controllers/adminProxy.php | 2 +- workflow/engine/controllers/installer.php | 2 +- workflow/engine/methods/oauth2/grant.php | 2 +- workflow/engine/skinEngine/base/error404.php | 2 +- workflow/engine/skinEngine/neoclassic/block.php | 2 +- workflow/engine/skinEngine/neoclassic/error404.php | 2 +- .../src/ProcessMaker/BusinessModel/Cases/OutputDocument.php | 2 +- workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php | 4 ++-- 14 files changed, 13 insertions(+), 13 deletions(-) mode change 100644 => 100755 workflow/engine/content/languages/en.js mode change 100644 => 100755 workflow/engine/content/languages/translation.en diff --git a/gulliver/methods/errors/block.php b/gulliver/methods/errors/block.php index 19b4a3106..05dd1aebe 100644 --- a/gulliver/methods/errors/block.php +++ b/gulliver/methods/errors/block.php @@ -3,7 +3,7 @@ if (function_exists("http_response_code")) { http_response_code(200); } -$http = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? "https" : "http"; +$http = G::is_https() ? "https" : "http"; $host = $_SERVER["SERVER_NAME"] . (($_SERVER["SERVER_PORT"] != "80") ? ":" . $_SERVER["SERVER_PORT"] : ""); $urlLogin = $http . "://" . $host . "/sys/en/neoclassic/login/login"; diff --git a/gulliver/methods/errors/error403.php b/gulliver/methods/errors/error403.php index c47080475..bc91e6f9d 100644 --- a/gulliver/methods/errors/error403.php +++ b/gulliver/methods/errors/error403.php @@ -1,6 +1,6 @@ process(((isset($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/files/' . $_SESSION['APPLICATION'] . '/outdocs/' . $sFilename . '.html', $g_media); + $status = $pipeline->process((G::is_https() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/files/' . $_SESSION['APPLICATION'] . '/outdocs/' . $sFilename . '.html', $g_media); copy(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf', $sPath . $sFilename . '.pdf'); unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf'); unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.html'); diff --git a/workflow/engine/content/languages/en.js b/workflow/engine/content/languages/en.js old mode 100644 new mode 100755 diff --git a/workflow/engine/content/languages/translation.en b/workflow/engine/content/languages/translation.en old mode 100644 new mode 100755 diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php index 8a5f43fdc..df7d0b660 100644 --- a/workflow/engine/controllers/adminProxy.php +++ b/workflow/engine/controllers/adminProxy.php @@ -1368,7 +1368,7 @@ class adminProxy extends HttpProxyController $pmRestClient->delete(); } - $http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; + $http = G::is_https() ? 'https' : 'http'; $lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en'; $host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : ''); diff --git a/workflow/engine/controllers/installer.php b/workflow/engine/controllers/installer.php index cef3f595d..dbe1b0572 100644 --- a/workflow/engine/controllers/installer.php +++ b/workflow/engine/controllers/installer.php @@ -427,7 +427,7 @@ class Installer extends Controller public function forceTogenerateTranslationsFiles ($url) { $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, G::browserCacheFilesUrl((isset($_SERVER["HTTPS"])? (($_SERVER["HTTPS"] != "")? "https://" : "http://") : "http://") . $_SERVER["HTTP_HOST"] . "/js/ext/translation.en.js?r=" . rand(1, 10000))); + curl_setopt($ch, CURLOPT_URL, G::browserCacheFilesUrl(( G::is_https()? "https://" : "http://" ) . $_SERVER["HTTP_HOST"] . "/js/ext/translation.en.js?r=" . rand(1, 10000))); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 60); diff --git a/workflow/engine/methods/oauth2/grant.php b/workflow/engine/methods/oauth2/grant.php index 88e90c138..6d2ab8547 100644 --- a/workflow/engine/methods/oauth2/grant.php +++ b/workflow/engine/methods/oauth2/grant.php @@ -7,7 +7,7 @@ if (! empty($_GET['error'])) { die(); } -$http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; +$http = G::is_https() ? 'https' : 'http'; $host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : ''); $endpoint = sprintf('%s://%s/%s/oauth2/token', $http, $host, SYS_SYS); $code = empty($_GET['code']) ? 'NN' : $_GET['code']; diff --git a/workflow/engine/skinEngine/base/error404.php b/workflow/engine/skinEngine/base/error404.php index c34ca9902..2bf587d83 100644 --- a/workflow/engine/skinEngine/base/error404.php +++ b/workflow/engine/skinEngine/base/error404.php @@ -1,6 +1,6 @@ process(((isset($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/files/' . $sApplication . '/outdocs/' . $sFilename . '.html', $g_media); + $status = $pipeline->process((\G::is_https() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/files/' . $sApplication . '/outdocs/' . $sFilename . '.html', $g_media); copy(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf', $sPath . $sFilename . '.pdf'); unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.pdf'); unlink(PATH_OUTPUT_FILE_DIRECTORY . $sFilename . '.html'); diff --git a/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php b/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php index 8a2f47d45..4e1563fc9 100644 --- a/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php +++ b/workflow/engine/src/ProcessMaker/Services/OAuth2/Server.php @@ -147,7 +147,7 @@ class Server implements iAuthenticate public function index() { - $http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; + $http = \G::is_https() ? 'https' : 'http'; $host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : ''); $host = $http .'://'. $host; @@ -183,7 +183,7 @@ class Server implements iAuthenticate session_start(); if (! isset($_SESSION['USER_LOGGED'])) { - $http = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; + $http = \G::is_https() ? 'https' : 'http'; $host = $http . '://' . $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : ''); $redirect = urlencode($host.'/'.self::$workspace.$_SERVER['REQUEST_URI']);