[otrs-cvs] otrs/Kernel/System Main.pm,1.68,1.69

"CVS commits notifications of OTRS.org" <[email protected]>
Newsgroups gmane.comp.otrs.cvs
Message-ID <[email protected]>
Comments:
Update of /home/cvs/otrs/Kernel/System
In directory lancelot:/tmp/cvs-serv17408/Kernel/System

Modified Files:
	Main.pm 
Log Message:
 - 2013-02-05 Fixed bug#9121 - Filenames with Unicode NFD are incorrectly reported as NFC by Main::DirectoryRead().

Author: mg

Index: Main.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/Main.pm,v
retrieving revision 1.68
retrieving revision 1.69
diff -2 -u -d -r1.68 -r1.69
--- Main.pm	28 Jan 2013 13:46:47 -0000	1.68
+++ Main.pm	5 Feb 2013 10:43:07 -0000	1.69
@@ -401,4 +401,7 @@
     );
 
+Platform note: MacOS (HFS+) stores filenames as Unicode NFD internally,
+and DirectoryRead() will also report them as NFD.
+
 =cut
 
@@ -783,70 +786,4 @@
 }
 
-=begin Internal:
-
-=cut
-
-sub _Dump {
-    my ( $Self, $Data ) = @_;
-
-    # data is not a reference
-    if ( !ref ${$Data} ) {
-        Encode::_utf8_off( ${$Data} );
-
-        return;
-    }
-
-    # data is a scalar reference
-    if ( ref ${$Data} eq 'SCALAR' ) {
-
-        # start recursion
-        $Self->_Dump( ${$Data} );
-
-        return;
-    }
-
-    # data is a hash reference
-    if ( ref ${$Data} eq 'HASH' ) {
-        KEY:
-        for my $Key ( sort keys %{ ${$Data} } ) {
-            next KEY if !defined ${$Data}->{$Key};
-
-            # start recursion
-            $Self->_Dump( \${$Data}->{$Key} );
-        }
-
-        return;
-    }
-
-    # data is a array reference
-    if ( ref ${$Data} eq 'ARRAY' ) {
-        KEY:
-        for my $Key ( 0 .. $#{ ${$Data} } ) {
-            next KEY if !defined ${$Data}->[$Key];
-
-            # start recursion
-            $Self->_Dump( \${$Data}->[$Key] );
-        }
-
-        return;
-    }
-
-    # data is a ref reference
-    if ( ref ${$Data} eq 'REF' ) {
-
-        # start recursion
-        $Self->_Dump( ${$Data} );
-
-        return;
-    }
-
-    $Self->{LogObject}->Log(
-        Priority => 'error',
-        Message  => "Unknown ref '" . ref( ${$Data} ) . "'!",
-    );
-
-    return;
-}
-
 =item DirectoryRead()
 
@@ -882,4 +819,7 @@
     );
 
+Platform note: MacOS (HFS+) stores filenames as Unicode NFD internally,
+and DirectoryRead() will also report them as NFD.
+
 =cut
 
@@ -951,11 +891,4 @@
         );
 
-        # second, convert it to combined normalization form (NFC), if it is an utf-8 string
-        # this has to be done because MacOS stores filenames as NFD on HFS+ partitions,
-        #   leading to data inconsistencies
-        if ( Encode::is_utf8($Filename) ) {
-            $Filename = Unicode::Normalize::NFC($Filename);
-        }
-
         push @Results, $Filename;
     }
@@ -966,4 +899,70 @@
 }
 
+=begin Internal:
+
+=cut
+
+sub _Dump {
+    my ( $Self, $Data ) = @_;
+
+    # data is not a reference
+    if ( !ref ${$Data} ) {
+        Encode::_utf8_off( ${$Data} );
+
+        return;
+    }
+
+    # data is a scalar reference
+    if ( ref ${$Data} eq 'SCALAR' ) {
+
+        # start recursion
+        $Self->_Dump( ${$Data} );
+
+        return;
+    }
+
+    # data is a hash reference
+    if ( ref ${$Data} eq 'HASH' ) {
+        KEY:
+        for my $Key ( sort keys %{ ${$Data} } ) {
+            next KEY if !defined ${$Data}->{$Key};
+
+            # start recursion
+            $Self->_Dump( \${$Data}->{$Key} );
+        }
+
+        return;
+    }
+
+    # data is a array reference
+    if ( ref ${$Data} eq 'ARRAY' ) {
+        KEY:
+        for my $Key ( 0 .. $#{ ${$Data} } ) {
+            next KEY if !defined ${$Data}->[$Key];
+
+            # start recursion
+            $Self->_Dump( \${$Data}->[$Key] );
+        }
+
+        return;
+    }
+
+    # data is a ref reference
+    if ( ref ${$Data} eq 'REF' ) {
+
+        # start recursion
+        $Self->_Dump( ${$Data} );
+
+        return;
+    }
+
+    $Self->{LogObject}->Log(
+        Priority => 'error',
+        Message  => "Unknown ref '" . ref( ${$Data} ) . "'!",
+    );
+
+    return;
+}
+
 1;
 
---------------------------------------------------------------------
OTRS mailing list: cvs-log - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/cvs-log
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/cvs-log
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.