[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/runtime/kurifilter-plugins
From:       David Faure <faure () kde ! org>
Date:       2010-08-24 8:56:20
Message-ID: 20100824085620.1234FAC867 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1167284 by dfaure:

Fix handling of invalid URLs (e.g. http://a[b]) since in Qt4 we don't get the input \
string back from QUrl.


 M  +2 -3      shorturi/kshorturifilter.cpp  
 M  +7 -4      tests/kurifiltertest.cpp  


--- trunk/KDE/kdebase/runtime/kurifilter-plugins/shorturi/kshorturifilter.cpp \
#1167283:1167284 @@ -341,7 +341,7 @@
   const QString abs_path = data.absolutePath();
 
   const bool canBeAbsolute = (protocol.isEmpty() && !abs_path.isEmpty());
-  const bool canBeLocalAbsolute = (canBeAbsolute && abs_path[0] =='/');
+  const bool canBeLocalAbsolute = (canBeAbsolute && abs_path[0] =='/' && \
!isMalformed);  bool exists = false;
 
   /*kDebug(7023) << "abs_path=" << abs_path
@@ -370,8 +370,7 @@
     }
   }
 
-  if( isLocalFullPath && !exists )
-  {
+  if (isLocalFullPath && !exists && !isMalformed) {
     exists = ( stat( QFile::encodeName(path).data() , &buff ) == 0 );
 
     if ( !exists ) {
--- trunk/KDE/kdebase/runtime/kurifilter-plugins/tests/kurifiltertest.cpp \
#1167283:1167284 @@ -202,9 +202,12 @@
     filter( "~foobar", 0, KUriFilterData::Error, QStringList( "kshorturifilter" ) );
 
     // Absolute Path tests for kshorturifilter
-    filter( "./", kdehome+"/share", KUriFilterData::LocalDir, QStringList( \
                "kshorturifilter" ), kdehome+"/share/" ); // cleanPath removes the \
                trailing slash
-    filter( "../", kdehome, KUriFilterData::LocalDir, QStringList( "kshorturifilter" \
                ), kdehome+"/share" );
-    filter( "config", kdehome+"/share/config", KUriFilterData::LocalDir, \
QStringList( "kshorturifilter" ), kdehome+"/share" ); +    const QStringList \
kshorturifilter( QString("kshorturifilter") ); +    filter( "./", kdehome+"/share", \
KUriFilterData::LocalDir, kshorturifilter, kdehome+"/share/" ); // cleanPath removes \
the trailing slash +    filter( "../", kdehome, KUriFilterData::LocalDir, \
kshorturifilter, kdehome+"/share" ); +    filter( "config", kdehome+"/share/config", \
KUriFilterData::LocalDir, kshorturifilter, kdehome+"/share" ); +    // Invalid URLs
+    filter( "http://a[b]", "http://a[b]", KUriFilterData::Unknown, kshorturifilter, \
"/" );  }
 
 void KUriFilterTest::refOrQuery()
@@ -272,7 +275,7 @@
 
     // The default search engine is set to 'Google'
     //this may fail if your DNS knows domains KDE or FTP
-    filter( "gg:", "http://www.google.com/search?q=gg%3A&ie=UTF-8&oe=UTF-8", \
KUriFilterData::NetProtocol ); +    filter( "gg:", "", KUriFilterData::NetProtocol ); \
                // see bug 56218
     filter( "KDE", "http://www.google.com/search?q=KDE&ie=UTF-8&oe=UTF-8", \
                KUriFilterData::NetProtocol );
     filter( "HTTP", "http://www.google.com/search?q=HTTP&ie=UTF-8&oe=UTF-8", \
KUriFilterData::NetProtocol );  }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic