File disable-idn-support.diff of Package kdelibs3

Index: kdecore/network/kresolver.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/network/kresolver.cpp,v
retrieving revision 1.42
diff -u -3 -p -r1.42 kresolver.cpp
--- kdecore/network/kresolver.cpp	13 Jan 2005 19:09:47 -0000	1.42
+++ kdecore/network/kresolver.cpp	8 Feb 2005 13:49:57 -0000
@@ -47,6 +47,7 @@
 
 // IDN
 #ifdef HAVE_IDNA_H
+# include <stdlib.h>
 # include <idna.h>
 #endif
 
@@ -991,6 +992,10 @@ static QStringList splitLabels(const QSt
 static QCString ToASCII(const QString& label)
 {
 #ifdef HAVE_IDNA_H
+  // We do disable it by default for security reasons for now.
+  if ( getenv("KDE_NO_IPV6") && strcmp( getenv("KDE_NO_IPV6"), "no" ) )
+     return label.latin1();
+
   // We have idna.h, so we can use the idna_to_ascii
   // function :)
 
@@ -1025,6 +1030,10 @@ static QCString ToASCII(const QString& l
 static QString ToUnicode(const QString& label)
 {
 #ifdef HAVE_IDNA_H
+  // We do disable it by default for security reasons for now.
+  if ( getenv("KDE_NO_IPV6") && strcmp( getenv("KDE_NO_IPV6"), "no" ) )
+     return label;
+
   // We have idna.h, so we can use the idna_to_unicode
   // function :)
 
openSUSE Build Service is sponsored by