Fixed bug #9632: Multiple fileuploads into folders with special characters (umlauts...
authorOliver Hader <oliver.hader@typo3.org>
Sat, 1 Nov 2008 17:22:58 +0000 (17:22 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sat, 1 Nov 2008 17:22:58 +0000 (17:22 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@4408 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/file_newfolder.php
typo3/file_upload.php

index b4921a3..a7963ae 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
        * Added feature #6637: Integrate possibility to reverse order of rootline HMENU (thanks to Ralf Hettinger)
        * Fixed bug #9715: Editing records with OpenDocs enabled does not work
        * Added feature #9094: Make simulate static a system extension (patch by Benjamin Mack)
+       * Fixed bug #9632: Multiple fileuploads into folders with special characters (umlauts) not possible (thanks to Marcus Krause)
 
 2008-10-31  Jeff Segars  <jeff@webempoweredchurch.org>
 
index 63e742f..af10e52 100755 (executable)
@@ -94,6 +94,13 @@ class SC_file_newfolder {
        var $shortPath;         // Relative path to current found filemount
        var $title;                     // Name of the filemount
 
+       /**
+        * Charset processing object
+        *
+        * @var t3lib_cs
+        */
+       protected $charsetConversion;
+
                // Internal, static (GPVar):
        var $number;
        var $target;            // Set with the target path inputted in &target
@@ -121,8 +128,12 @@ class SC_file_newfolder {
                $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions');
                $this->basicff->init($GLOBALS['FILEMOUNTS'],$TYPO3_CONF_VARS['BE']['fileExtensions']);
 
+                       // Init basic-charset-functions object:
+               $this->charsetConversion = t3lib_div::makeInstance('t3lib_cs');
+
                        // Cleaning and checking target
-               $this->target=$this->basicff->is_directory($this->target);
+               $this->target = $this->charsetConversion->conv($this->target, 'utf-8', $GLOBALS['LANG']->charSet);
+               $this->target = $this->basicff->is_directory($this->target);
                $key=$this->basicff->checkPathAgainstMounts($this->target.'/');
                if (!$this->target || !$key)    {
                        t3lib_BEfunc::typo3PrintError ('Parameter Error','Target was not a directory!','');
@@ -153,7 +164,9 @@ class SC_file_newfolder {
 
                        function reload(a)      {       //
                                if (!changed || (changed && confirm('.$LANG->JScharCode($LANG->sL('LLL:EXT:lang/locallang_core.php:mess.redraw')).')))  {
-                                       var params = "&target="+escape(path)+"&number="+a+"&returnUrl="+escape("' . $this->returnUrl . '");
+                                       var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl='
+                                                       . urlencode($this->charsetConversion->conv($this->returnUrl, $GLOBALS['LANG']->charSet, 'utf-8'))
+                                                       . '";
                                        window.location.href = "file_newfolder.php?"+params;
                                }
                        }
@@ -305,4 +318,4 @@ $SOBE = t3lib_div::makeInstance('SC_file_newfolder');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-?>
+?>
\ No newline at end of file
index e3eb334..8ea0d18 100755 (executable)
@@ -97,6 +97,13 @@ class SC_file_upload {
        var $shortPath;         // Relative path to current found filemount
        var $title;                     // Name of the filemount
 
+       /**
+        * Charset processing object
+        *
+        * @var t3lib_cs
+        */
+       protected $charsetConversion;
+
                // Internal, static (GPVar):
        var $number;
        var $target;            // Set with the target path inputted in &target
@@ -130,8 +137,12 @@ class SC_file_upload {
                $this->basicff = t3lib_div::makeInstance('t3lib_basicFileFunctions');
                $this->basicff->init($GLOBALS['FILEMOUNTS'],$TYPO3_CONF_VARS['BE']['fileExtensions']);
 
+                       // Init basic-charset-functions object:
+               $this->charsetConversion = t3lib_div::makeInstance('t3lib_cs');
+
                        // Cleaning and checking target
-               $this->target=$this->basicff->is_directory($this->target);              // Cleaning and checking target
+               $this->target = $this->charsetConversion->conv($this->target, 'utf-8', $GLOBALS['LANG']->charSet);
+               $this->target = $this->basicff->is_directory($this->target);
                $key=$this->basicff->checkPathAgainstMounts($this->target.'/');
                if (!$this->target || !$key)    {
                        t3lib_BEfunc::typo3PrintError ('Parameter Error','Target was not a directory!','');
@@ -168,7 +179,9 @@ class SC_file_upload {
 
                        function reload(a)      {       //
                                if (!changed || (changed '.$confirm.')) {
-                                       var params = "&target="+escape(path)+"&number="+a+"&returnUrl='.htmlspecialchars($this->returnUrl).'";
+                                       var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl='
+                                                       . urlencode($this->charsetConversion->conv($this->returnUrl, $GLOBALS['LANG']->charSet, 'utf-8'))
+                                                       . '";
                                        window.location.href = "file_upload.php?"+params;
                                }
                        }
@@ -294,4 +307,4 @@ $SOBE = t3lib_div::makeInstance('SC_file_upload');
 $SOBE->init();
 $SOBE->main();
 $SOBE->printContent();
-?>
+?>
\ No newline at end of file