=== modified file 'modules/user/user.module'
--- modules/user/user.module	2010-10-08 05:28:30 +0000
+++ modules/user/user.module	2010-10-11 06:41:19 +0000
@@ -1409,7 +1409,8 @@ function template_preprocess_user_pictur
     }
     if (isset($filepath)) {
       $alt = t("@user's picture", array('@user' => format_username($account)));
-      if (module_exists('image') && $style = variable_get('user_picture_style', '')) {
+      // If the image does not have a valid Drupal scheme, don't load image styles.
+      if (module_exists('image') && file_valid_uri($filepath) && $style = variable_get('user_picture_style', '')) {
         $variables['user_picture'] = theme('image_style', array('style_name' => $style, 'path' => $filepath, 'alt' => $alt, 'title' => $alt));
       }
       else {

=== modified file 'modules/user/user.test'
--- modules/user/user.test	2010-10-05 06:17:28 +0000
+++ modules/user/user.test	2010-10-11 06:53:36 +0000
@@ -916,6 +916,28 @@ class UserPictureTestCase extends Drupal
     }
   }
 
+  /**
+   * Do the test:
+   *  Picture is valid URL
+   *
+   * results: The image should be displayed
+   */
+  function testExternalPicture() {
+    $this->drupalLogin($this->user);
+    $images = $this->drupalGetTestFiles('image');
+    $image = $images[0];
+    $pic_path = file_create_url($image->uri);
+    variable_set('user_picture_default', $pic_path);
+
+    // Check if image is displayed in user's profile page.
+    $this->drupalGet('user');
+
+    // Get the user picture image via xpath.
+    $elements = $this->xpath('//div[@class="user-picture"]/img');
+    $this->assertEqual(count($elements), 1, t("There is exactly one user picture on the user's profile page"));
+    $this->assertEqual($pic_path, (string) $elements[0]['src'], t("User picture source is correct."));
+  }
+
   function saveUserPicture($image) {
     $edit = array('files[picture_upload]' => drupal_realpath($image->uri));
     $this->drupalPost('user/' . $this->user->uid . '/edit', $edit, t('Save'));

