diff --git a/filefield_paths.module b/filefield_paths.module
index ff4e32a..dba5ffc 100644
--- a/filefield_paths.module
+++ b/filefield_paths.module
@@ -284,7 +284,7 @@ function _filefield_paths_replace_path($old, $new, $entity) {
   $info = parse_url(file_stream_wrapper_uri_normalize($old));
   $info['path'] = !empty($info['path']) ? $info['path'] : '';
   $absolute = str_replace("{$info['host']}{$info['path']}", '', file_create_url($old));
-  $relative = parse_url($absolute, PHP_URL_PATH);
+  $relative = @parse_url($absolute, PHP_URL_PATH);
   $regex = str_replace('/', '\/', "({$absolute}|{$relative}|{$info['scheme']}://)(styles/([a-z0-9\-_/]*?)/{$info['scheme']}/|)({$info['host']}{$info['path']})");
 
   // Build replacement.
