We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2093ae2 commit 6023652Copy full SHA for 6023652
src/main/php/io/Path.class.php
@@ -228,9 +228,9 @@ public function asFolder(bool $existing= false): Folder {
228
* it only removes redundant elements.
229
*/
230
public function normalize(): self {
231
- if (2 === sscanf($this->path, '%c%*[:]', $drive)) {
+ if (strlen($this->path) > 1 && ':' === $this->path{1}) {
232
$components= explode(DIRECTORY_SEPARATOR, substr($this->path, 3));
233
- $normalized= [strtoupper($drive).':'];
+ $normalized= [strtoupper($this->path{0}).':'];
234
} else {
235
$components= explode(DIRECTORY_SEPARATOR, $this->path);
236
$normalized= [];
0 commit comments