From e1694296e7b99b1442562b79d236d3397d37e7bd Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Wed, 8 Apr 2015 17:51:42 -0400 Subject: [PATCH 1/4] PM-2127 Admin>Settings>Logo En windows Server 2012 y WIndows 7 no permite cargar un logo Se valido el path en windows --- workflow/engine/controllers/adminProxy.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php index 3be771ff1..ba4d16731 100644 --- a/workflow/engine/controllers/adminProxy.php +++ b/workflow/engine/controllers/adminProxy.php @@ -1055,6 +1055,22 @@ class adminProxy extends HttpProxyController $aMessage1 = array(); $fileName = trim(str_replace(' ', '_', $namefile)); $fileName = self::changeNamelogo($fileName); + + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + $tmpFile = str_replace("\\\\","\\",$tmpFile,$count); + if(!$count) { + $tmpFileName = basename($tmpFile); + $winPath = explode("\\", $tmpFile); + $tmpFile = ""; + foreach($winPath as $k => $v){ + if($v != "") { + $tmpFile.= $v."\\"; + } + } + $tmpFile = substr($tmpFile,0,-1); + } + } + G::uploadFile($tmpFile, $dir, 'tmp' . $fileName); try { if (extension_loaded('exif')) { From 4cde7a2c70d68dc78383bf5705401c8d19cb6780 Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Thu, 9 Apr 2015 11:42:33 -0400 Subject: [PATCH 2/4] PM-2127 Admin>Settings>Logo En windows Server 2012 y WIndows 7 no permite cargar un logo Se valido el path en windows --- gulliver/system/class.g.php | 14 ++++++++++++++ workflow/engine/controllers/adminProxy.php | 16 ---------------- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 201409e23..6564039fc 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -2636,6 +2636,20 @@ class G G::verifyPath( $path, true ); } + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + $file = str_replace("\\\\","\\",$file,$count); + if(!$count) { + $winPath = explode("\\", $file); + $file = ""; + foreach($winPath as $k => $v){ + if($v != "") { + $file.= $v."\\"; + } + } + $file = substr($file,0,-1); } + } + } + G::LoadSystem('inputfilter'); $filter = new InputFilter(); $file = $filter->validateInput($file, "path"); diff --git a/workflow/engine/controllers/adminProxy.php b/workflow/engine/controllers/adminProxy.php index ba4d16731..3be771ff1 100644 --- a/workflow/engine/controllers/adminProxy.php +++ b/workflow/engine/controllers/adminProxy.php @@ -1055,22 +1055,6 @@ class adminProxy extends HttpProxyController $aMessage1 = array(); $fileName = trim(str_replace(' ', '_', $namefile)); $fileName = self::changeNamelogo($fileName); - - if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $tmpFile = str_replace("\\\\","\\",$tmpFile,$count); - if(!$count) { - $tmpFileName = basename($tmpFile); - $winPath = explode("\\", $tmpFile); - $tmpFile = ""; - foreach($winPath as $k => $v){ - if($v != "") { - $tmpFile.= $v."\\"; - } - } - $tmpFile = substr($tmpFile,0,-1); - } - } - G::uploadFile($tmpFile, $dir, 'tmp' . $fileName); try { if (extension_loaded('exif')) { From 29de737b2a845448889348d33dfac94d0f8f9806 Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Thu, 9 Apr 2015 11:50:46 -0400 Subject: [PATCH 3/4] PM-2127 Admin>Settings>Logo En windows Server 2012 y WIndows 7 no permite cargar un logo Se valido el path en windows --- gulliver/system/class.g.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 6564039fc..061fb790a 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -2637,17 +2637,17 @@ class G } if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { - $file = str_replace("\\\\","\\",$file,$count); - if(!$count) { - $winPath = explode("\\", $file); - $file = ""; - foreach($winPath as $k => $v){ - if($v != "") { - $file.= $v."\\"; - } + $file = str_replace("\\\\","\\",$file,$count); + if(!$count) { + $winPath = explode("\\", $file); + $file = ""; + foreach($winPath as $k => $v){ + if($v != "") { + $file.= $v."\\"; } - $file = substr($file,0,-1); } - } + } + $file = substr($file,0,-1); } + } } G::LoadSystem('inputfilter'); From 0966c97258a5979854cb538d6107de865c903799 Mon Sep 17 00:00:00 2001 From: "marcelo.cuiza" Date: Thu, 9 Apr 2015 12:03:32 -0400 Subject: [PATCH 4/4] PM-2127 Admin>Settings>Logo En windows Server 2012 y WIndows 7 no permite cargar un logo Se valido el path en windows --- gulliver/system/class.g.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 061fb790a..846fbd558 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -2634,20 +2634,20 @@ class G $oldumask = umask( 0 ); if (! is_dir( $path )) { G::verifyPath( $path, true ); - } + } if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { $file = str_replace("\\\\","\\",$file,$count); if(!$count) { - $winPath = explode("\\", $file); + $winPath = explode("\\",$file); $file = ""; foreach($winPath as $k => $v){ if($v != "") { $file.= $v."\\"; } } - $file = substr($file,0,-1); } - } + $file = substr($file,0,-1); + } } G::LoadSystem('inputfilter');