In the stream_open() function of the DrupalLocalStreamWrapper class, the parameter $opened_path is passed in by reference, but in the function the data is saved to $opened_url.

This bug was actually mentioned in the original stream wrapper issue #227232: Support PHP stream wrappers at #164, was fixed in #166, broken again by renaming the parameter to $opened_uri at #168, and reverted all the way back to $opened_path at #181. o_O

Anyways this patch fixes the issue.

CommentFileSizeAuthor
#4 694242.patch694 bytesgdd
opened_url.patch845 bytesgdd

Comments

gdd’s picture

opened_url.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, opened_url.patch, failed testing.

asimmonds’s picture

In the PHP documentation, the function prototype for stream_open() uses $opened_path

public bool streamWrapper::stream_open  (  string $path  ,  string $mode  ,  int $options  ,  string &$opened_path  )

so I think we should stick to what they use.

Is there any preference for either option?

gdd’s picture

Status: Needs work » Needs review
StatusFileSize
new694 bytes

I completely lost track of this patch somehow. Anyways I think asimmonds' fix is correct, we should match the function prototype. So I've reversed the original implementation, now I have modified the function body and left the signature intact.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.