Don't URL encode ./:[] because they are to be found in URLs...
authorRémi Denis-Courmont <rem@videolan.org>
Fri, 12 Aug 2005 19:44:52 +0000 (19:44 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Fri, 12 Aug 2005 19:44:52 +0000 (19:44 +0000)
closes #311

include/network.h

index 8a2a536..cf176df 100644 (file)
@@ -218,7 +218,11 @@ static inline int isurlsafe( int c )
     return ( (unsigned char)( c - 'a' ) < 26 )
         || ( (unsigned char)( c - 'A' ) < 26 )
         || ( (unsigned char)( c - '0' ) < 10 )
-        || ( strchr( "-_.", c ) != NULL );
+        /* Hmm, we should not encode character that are allowed in URLs
+         * (even if they are not URL-safe), nor URL-safe characters.
+         * We still encode some of them because of Microsoft's crap browser.
+         */
+        || ( strchr( "/:.[]-_.", c ) != NULL );
 }
 
 /*****************************************************************************