API page: http://api.drupal.org/api/drupal/includes--stream_wrappers.inc/function/...

The function, instead of updating the value of the argument passes by reference, initialize the value of a local variable.

public function stream_open($uri, $mode, $options, &$opened_path) {
  $this->uri = $uri;
  $path = $this->getLocalPath();
  $this->handle = ($options & STREAM_REPORT_ERRORS) ? fopen($path, $mode) : @fopen($path, $mode);

  if ((bool) $this->handle && $options & STREAM_USE_PATH) {
    $opened_url = $path;
  }

  return (bool) $this->handle;
}

The parameter is &$opened_path, but the used variable is $opened_url. This means the caller doesn't get back the path of the file being opened.

CommentFileSizeAuthor
#2 parameter-for-stream-open-1224802.patch539 bytesapaderno
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jbrown’s picture

Version: 7.x-dev » 8.x-dev
apaderno’s picture

Status: Active » Needs review
FileSize
539 bytes
jbrown’s picture

Status: Needs review » Reviewed & tested by the community
xjm’s picture

Tagging issues not yet using summary template.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Good catch. Committed to 7.x and 8.x.

Automatically closed -- issue fixed for 2 weeks with no activity.