diff includes/common.inc @ 9:acef7ccb09b5 6.4

Drupal 6.4
author Franck Deroche <webmaster@defr.org>
date Tue, 23 Dec 2008 14:32:08 +0100
parents fff6d4c8c043
children 589fb7c02327
line wrap: on
line diff
--- a/includes/common.inc	Tue Dec 23 14:30:28 2008 +0100
+++ b/includes/common.inc	Tue Dec 23 14:32:08 2008 +0100
@@ -1,5 +1,5 @@
 <?php
-// $Id: common.inc,v 1.756.2.20 2008/07/09 21:48:27 goba Exp $
+// $Id: common.inc,v 1.756.2.24 2008/08/13 23:59:12 drumm Exp $
 
 /**
  * @file
@@ -435,6 +435,16 @@
   // Parse the URL and make sure we can handle the schema.
   $uri = parse_url($url);
 
+  if ($uri == FALSE) {
+    $result->error = 'unable to parse URL';
+    return $result;
+  }
+
+  if (!isset($uri['scheme'])) {
+    $result->error = 'missing schema';
+    return $result;
+  }
+
   switch ($uri['scheme']) {
     case 'http':
       $port = isset($uri['port']) ? $uri['port'] : 80;
@@ -3234,7 +3244,7 @@
   if (empty($schema)) {
     return FALSE;
   }
-  
+
   // Convert to an object if needed.
   if (is_array($object)) {
     $object = (object) $object;