Skip to content

Review __toString handling for path part #3

@AnrDaemon

Description

@AnrDaemon

See

net-url/src/Net/Url.php

Lines 435 to 443 in 78602b1

$path = explode('%2F', $parts['path']);
$result .= implode('%2F', array_map(function($part){
/*
BUG?: paths containing, f.e., "@" are encoded.
For future reference:
https://tools.ietf.org/html/rfc3986#section-2.2
*/
return implode('/', array_map('rawurlencode', explode('/', $part)));
}, $path));

Perhaps, use array_reduce to flatten the path directly into string.

Imported from AnrDaemon/library-php#3

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions