--- gimp-2.3.9/tools/gimp-remote.c.orig	2006-06-22 22:01:43.000000000 +0200
+++ gimp-2.3.9/tools/gimp-remote.c	2006-06-22 22:40:35.000000000 +0200
@@ -331,6 +331,40 @@
   textdomain (GETTEXT_PACKAGE);
 }
 
+/* Check name for a valid URI scheme as described in RFC 2396.
+ * URI scheme:suffix with scheme = [alpha][alphanum|digit|+|-|.]*
+ * Note that a null suffix will be considered as an invalid URI.
+ * return 1 if valid scheme found, else 0
+ */
+static gint
+is_valid_uri(const gchar *name)
+{
+  const gchar *c = name;
+
+  if (name == NULL)
+    return 0;
+
+  /* first character must be alpha */
+  if (!g_ascii_isalpha (*c))
+    return 0;
+
+  c++;
+  while (*c != '\0' && *c != ':')
+    {
+      if (! g_ascii_isalnum(*c) && *c != '+' && *c != '-' && *c != '.')
+	return 0;
+      c++;
+    }
+
+  if (*c == ':')
+    {
+      c++;
+      if (*c != '\0')
+	return 1;
+    }
+  return 0;
+} 
+
 gint
 main (gint    argc,
       gchar **argv)
@@ -379,10 +413,7 @@
           gchar       *uri;
 
           /* If not already a valid URI */
-          if (g_ascii_strncasecmp ("file:",  name, 5) &&
-              g_ascii_strncasecmp ("ftp:",   name, 4) &&
-              g_ascii_strncasecmp ("http:",  name, 5) &&
-              g_ascii_strncasecmp ("https:", name, 6))
+          if (! is_valid_uri (name))
             {
               if (g_path_is_absolute (name))
                 {
