Posted by kiamlaluno on July 20, 2011 at 7:12pm
5 followers
| Project: | Drupal core |
| Version: | 8.x-dev |
| Component: | file system |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
| Issue tags: | Needs issue summary update |
Issue Summary
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.
<?php
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.
Comments
#1
#2
#3
#4
Tagging issues not yet using summary template.
#5
Good catch. Committed to 7.x and 8.x.
#6
Automatically closed -- issue fixed for 2 weeks with no activity.