From 157f04d32830b1abf7c3682a2c4115ba9fccae25 Mon Sep 17 00:00:00 2001 From: Brayan Pereyra Date: Tue, 23 Sep 2025 19:52:18 +0000 Subject: [PATCH] TASK-232 Change encryt with URL_KEY and Deprecate encryptlink --- config/app.php | 2 +- framework/src/Maveriks/WebApplication.php | 2 +- gulliver/system/class.bootstrap.php | 4 ++-- gulliver/system/class.g.php | 4 ++-- gulliver/system/class.xmlform.php | 3 --- workflow/engine/classes/XmlFormFieldToolButton.php | 6 ------ workflow/engine/config/paths.php | 2 +- workflow/public_html/sysGeneric.php | 6 +++--- 8 files changed, 10 insertions(+), 19 deletions(-) diff --git a/config/app.php b/config/app.php index c74b539f3..907bfdc7a 100644 --- a/config/app.php +++ b/config/app.php @@ -10,7 +10,7 @@ return [ 'env' => env('APP_ENV', 'production'), 'debug' => env('APP_DEBUG', false), 'cache_lifetime' => env('APP_CACHE_LIFETIME', 3600), //laravel 8.x the time parameter is in seconds. - 'key' => env('APP_KEY', 'base64:rU28h/tElUn/eiLY0qC24jJq1rakvAFRoRl1DWxj/kM='), + 'key' => env('APP_KEY', 'THVyYW5AU29mdF9PcHRpbXVzUHJpbWU='), 'cipher' => 'AES-256-CBC', 'timezone' => 'UTC', 'providers' => [ diff --git a/framework/src/Maveriks/WebApplication.php b/framework/src/Maveriks/WebApplication.php index 73fac94bb..05bbb847d 100644 --- a/framework/src/Maveriks/WebApplication.php +++ b/framework/src/Maveriks/WebApplication.php @@ -603,7 +603,7 @@ class WebApplication * Global definitions, before it was the defines.php file */ // URL Key - define("URL_KEY", 'c0l0s40pt1mu59r1m3'); + define('URL_KEY', config('app.key')); // Other definitions define('TIMEOUT_RESPONSE', 100); //web service timeout diff --git a/gulliver/system/class.bootstrap.php b/gulliver/system/class.bootstrap.php index 7a7742f30..41d334223 100644 --- a/gulliver/system/class.bootstrap.php +++ b/gulliver/system/class.bootstrap.php @@ -2519,14 +2519,14 @@ class Bootstrap } /** - * Encrypt URL + * Encrypt URL DEPRECATED * * @author Fernando Ontiveros Lira * @access public * @param string $urlLink * @return string */ - public function encryptlink($url) + public function encryptlinkDeprecated($url) { if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') { return urlencode(Bootstrap::encrypt($url, URL_KEY)); diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index d8ccb380d..14d64cc8c 100644 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -770,14 +770,14 @@ class G } /** - * Encrypt URL + * Encrypt URL DEPRECATED * * @author Fernando Ontiveros Lira * @access public * @param string $urlLink * @return string */ - public static function encryptlink($url) + public static function encryptlinkDeprecated($url) { if (defined('ENABLE_ENCRYPT') && ENABLE_ENCRYPT == 'yes') { return urlencode(G::encrypt($url, URL_KEY)); diff --git a/gulliver/system/class.xmlform.php b/gulliver/system/class.xmlform.php index 1ba801356..09f9e3665 100644 --- a/gulliver/system/class.xmlform.php +++ b/gulliver/system/class.xmlform.php @@ -5694,9 +5694,6 @@ class XmlFormFieldImage extends XmlFormField public function render($value = null, $owner = null) { $url = G::replaceDataField($this->file, $owner->values); - if ($this->home === "methods") { - $url = G::encryptlink(SYS_URI . $url); - } if ($this->home === "public_html") { $url = '/' . $url; } diff --git a/workflow/engine/classes/XmlFormFieldToolButton.php b/workflow/engine/classes/XmlFormFieldToolButton.php index d72811e75..facd864a6 100644 --- a/workflow/engine/classes/XmlFormFieldToolButton.php +++ b/workflow/engine/classes/XmlFormFieldToolButton.php @@ -36,17 +36,11 @@ class XmlFormFieldToolButton extends XmlFormField public function render($value = null, $paramDummy2 = null) { $url = $this->file; - if ($this->home === "methods") { - $url = G::encryptlink(SYS_URI . $url); - } if ($this->home === "public_html") { $url = '/' . $url; } $urlAlt = $this->fileAlt; if ($this->fileAlt !== '') { - if ($this->home === "methods") { - $urlAlt = G::encryptlink(SYS_URI . $urlAlt); - } if ($this->home === "public_html") { $urlAlt = '/' . $urlAlt; } diff --git a/workflow/engine/config/paths.php b/workflow/engine/config/paths.php index e2051908c..3d5e3f8df 100644 --- a/workflow/engine/config/paths.php +++ b/workflow/engine/config/paths.php @@ -114,7 +114,7 @@ */ // URL Key - define("URL_KEY", 'c0l0s40pt1mu59r1m3' ); + define('URL_KEY', config('app.key')); // Other definitions define('TIMEOUT_RESPONSE', 100 ); //web service timeout diff --git a/workflow/public_html/sysGeneric.php b/workflow/public_html/sysGeneric.php index dbfadb872..23eb99e6e 100644 --- a/workflow/public_html/sysGeneric.php +++ b/workflow/public_html/sysGeneric.php @@ -112,8 +112,6 @@ set_include_path( * Global definitions */ -// URL Key -define("URL_KEY", 'c0l0s40pt1mu59r1m3'); // Application settings define('TIMEOUT_RESPONSE', 100); //web service timeout in seconds @@ -330,7 +328,6 @@ if (!file_exists(PATH_HTML . 'index.html')) { // if not, create it from template ))); } - define('SYS_URI', '/sys' . SYS_TEMP . '/' . SYS_LANG . '/' . SYS_SKIN . '/'); // defining the serverConf singleton @@ -367,6 +364,9 @@ ini_set('date.timezone', TIME_ZONE); //Set Time Zone date_default_timezone_set(TIME_ZONE); +// URL Key +define('URL_KEY', config('app.key')); + config(['app.timezone' => TIME_ZONE]); // Load Language Translation