diff --git a/includes/stream_wrappers.inc b/includes/stream_wrappers.inc
index 3c88f3d8f73200090107618f55c7795a5ceff54b..9a9b06171a92c73228df7c33c067a4c9e47b4237 100644
--- a/includes/stream_wrappers.inc
+++ b/includes/stream_wrappers.inc
@@ -401,7 +401,7 @@ public function stream_open($uri, $mode, $options, &$opened_path) {
     $this->handle = ($options & STREAM_REPORT_ERRORS) ? fopen($path, $mode) : @fopen($path, $mode);
 
     if ((bool) $this->handle && $options & STREAM_USE_PATH) {
-      $opened_url = $path;
+      $opened_path = $path;
     }
 
     return (bool) $this->handle;