diff --git a/core/includes/file.inc b/core/includes/file.inc
index 858c4a6..c808b8e 100644
--- a/core/includes/file.inc
+++ b/core/includes/file.inc
@@ -282,8 +282,10 @@ function file_stream_wrapper_get_instance_by_scheme($scheme) {
  * @return string
  *   A string containing a URL that may be used to access the file.
  *   If the provided string already contains a preceding 'http', 'https', or
- *   '/', nothing is done and the same string is returned. If a stream wrapper
- *   could not be found to generate an external URL, then FALSE is returned.
+ *   '/', nothing is done and the same string is returned. If string is a
+ *   relative path e.g. has no scheme and does not contain a preceding '/' the
+ *   path is extended to full path. If a stream wrapper could not be found to
+ *   generate an external URL, then FALSE is returned.
  *
  * @see http://drupal.org/node/515192
  * @see file_url_transform_relative()
@@ -298,8 +300,8 @@ function file_create_url($uri) {
   if (!$scheme) {
     // Allow for:
     // - root-relative URIs (e.g. /foo.jpg in http://example.com/foo.jpg)
-    // - protocol-relative URIs (e.g. //bar.jpg, which is expanded to
-    //   http://example.com/bar.jpg by the browser when viewing a page over
+    // - protocol-relative URIs (e.g. //example.com/bar.jpg, which is expanded
+    //   to http://example.com/bar.jpg by the browser when viewing a page over
     //   HTTP and to https://example.com/bar.jpg when viewing a HTTPS page)
     // Both types of relative URIs are characterized by a leading slash, hence
     // we can use a single check.
@@ -307,10 +309,13 @@ function file_create_url($uri) {
       return $uri;
     }
     else {
-      // If this is not a properly formatted stream, then it is a shipped file.
-      // Therefore, return the urlencoded URI with the base URL prepended.
+      // This is a shipped file and the path is relative to the Drupal
+      // installation. Therefore, return the urlencoded URI
+      // with the base path prepended. Base path is used because there should be
+      // no need to make a relative URI absolute which the use of base URL
+      // would do.
       $options = UrlHelper::parse($uri);
-      $path = $GLOBALS['base_url'] . '/' . UrlHelper::encodePath($options['path']);
+      $path = $GLOBALS['base_path'] . UrlHelper::encodePath($options['path']);
       // Append the query.
       if ($options['query']) {
         $path .= '?' . UrlHelper::buildQuery($options['query']);
diff --git a/core/modules/file/src/Tests/DownloadTest.php b/core/modules/file/src/Tests/DownloadTest.php
index 22bee7a..a830e35 100644
--- a/core/modules/file/src/Tests/DownloadTest.php
+++ b/core/modules/file/src/Tests/DownloadTest.php
@@ -38,9 +38,10 @@ function testPublicFileTransfer() {
     // Test generating an URL to a shipped file (i.e. a file that is part of
     // Drupal core, a module or a theme, for example a JavaScript file).
     $filepath = 'core/assets/vendor/jquery/jquery.min.js';
-    $url = file_create_url($filepath);
-    $this->assertEqual($GLOBALS['base_url'] . '/' . $filepath, $url, 'Correctly generated a URL for a shipped file.');
-    $this->drupalHead($url);
+    $relative_url = file_create_url($filepath);
+    $absolute_url = $this->getAbsoluteUrl($relative_url);
+    $this->assertEqual($GLOBALS['base_path'] . $filepath, $relative_url, 'Correctly generated a URL for a shipped file.');
+    $this->drupalHead($absolute_url);
     $this->assertResponse(200, 'Confirmed that the generated URL is correct by downloading the shipped file.');
   }
 
