From 725970d7433bbe6715d966b497dbefe63c128e10 Mon Sep 17 00:00:00 2001
From: Neil Drumm <drumm@delocalizedham.com>
Date: Sun, 22 Apr 2012 21:20:53 -0700
Subject: [PATCH] [#1542854] Only replace $basename once, so filenames are not
 replaced too.

---
 modules/system/system.install |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/system/system.install b/modules/system/system.install
index 0b4e1fa..83767a2 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -2791,7 +2791,7 @@ function system_update_7061(&$sandbox) {
       foreach ($revision['file'][LANGUAGE_NONE] as $delta => $file) {
         // We will convert filepaths to uri using the default scheme
         // and stripping off the existing file directory path.
-        $file['uri'] = $scheme . str_replace($basename, '', $file['filepath']);
+        $file['uri'] = $scheme . str_replace($basename, '', $file['filepath'], 1);
         $file['uri'] = file_stream_wrapper_uri_normalize($file['uri']);
         unset($file['filepath']);
         // Insert into the file_managed table.
-- 
1.7.5.4

