Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37403078
en ru br
Репозитории ALT
5.1: 4.4.5-alt0.M51.1
4.1: 4.1.3-alt0.M41.2
www.altlinux.org/Changes

Группа :: Система/Библиотеки
Пакет: kde4pimlibs

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: r1096001.patch
Скачать


--- trunk/KDE/kdepimlibs/kmime/kmime_header_parsing.cpp	2010/02/25 13:13:42	1096000
+++ trunk/KDE/kdepimlibs/kmime/kmime_header_parsing.cpp	2010/02/25 13:14:02	1096001
@@ -1608,6 +1608,12 @@
     NoMode = 0x0, Continued = 0x1, Encoded = 0x2
   } mode;
 
+  enum EncodingModes {
+    NoEncoding =  0x0,
+    RFC2047 = 0x1,
+    RFC2231 = 0x2
+  } encodingMode;
+
   QMap<QString,QStringOrQPair>::Iterator it, end = rawParameterList.end();
 
   for ( it = rawParameterList.begin() ; it != end ; ++it ) {
@@ -1628,6 +1634,12 @@
       if ( attribute.endsWith( asterisk ) ) {
         attribute.truncate( attribute.length() - 1 );
         mode = (Modes) ((int) mode | Encoded);
+        encodingMode = (EncodingModes) ((int) encodingMode | RFC2231);
+      }
+      // is the value rfc2047 encoded?
+      if( !(*it).qstring.isNull() && (*it).qstring.startsWith( "=?" ) ) {
+        mode = (Modes) ((int) mode | Encoded);
+        encodingMode = (EncodingModes) ((int) encodingMode | RFC2047);
       }
       // is the value continued?
       if ( attribute.endsWith( asteriskZero ) ) {
@@ -1638,9 +1650,14 @@
       // decode if necessary:
       //
       if ( mode & Encoded ) {
-        decodeRFC2231Value( rfc2231Codec, textcodec,
-                            false, /* isn't continuation */
-                            value, (*it).qpair );
+        if( encodingMode & RFC2231 ) {
+          decodeRFC2231Value( rfc2231Codec, textcodec,
+                              false, /* isn't continuation */
+                              value, (*it).qpair );
+        }
+        if( encodingMode & RFC2047 ) {
+          value += decodeRFC2047String( (*it).qstring.toLatin1() );
+        }
       } else {
         // not encoded.
         if ( (*it).qpair.first ) {
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin