@@ 5443-5447 (lines=5) @@ | ||
5440 | $input = '/'; |
|
5441 | } |
|
5442 | // C: if the input buffer begins with a prefix of "/../" or "/..", where ".." is a complete path segment, then replace that prefix with "/" in the input buffer and remove the last segment and its preceding "/" (if any) from the output buffer; otherwise, |
|
5443 | elseif (strpos($input, '/../') === 0) |
|
5444 | { |
|
5445 | $input = substr($input, 3); |
|
5446 | $output = substr_replace($output, '', strrpos($output, '/')); |
|
5447 | } |
|
5448 | elseif ($input === '/..') |
|
5449 | { |
|
5450 | $input = '/'; |
|
@@ 5459-5463 (lines=5) @@ | ||
5456 | $input = ''; |
|
5457 | } |
|
5458 | // E: move the first path segment in the input buffer to the end of the output buffer, including the initial "/" character (if any) and any subsequent characters up to, but not including, the next "/" character or the end of the input buffer |
|
5459 | elseif (($pos = strpos($input, '/', 1)) !== false) |
|
5460 | { |
|
5461 | $output .= substr($input, 0, $pos); |
|
5462 | $input = substr_replace($input, '', 0, $pos); |
|
5463 | } |
|
5464 | else |
|
5465 | { |
|
5466 | $output .= $input; |