| @@ 418-424 (lines=7) @@ | ||
| 415 | // the directory portion |
|
| 416 | $end = array_pop($url_path); |
|
| 417 | foreach ($url_path as $segment) { |
|
| 418 | if ($segment == '.') { |
|
| 419 | // skip |
|
| 420 | } else if ($segment == '..' && $path && $path[sizeof($path)-1] != '..') { |
|
| 421 | array_pop($path); |
|
| 422 | } else { |
|
| 423 | $path[] = $segment; |
|
| 424 | } |
|
| 425 | } |
|
| 426 | // Step 6d, 6f: remove "." and ".." from file portion |
|
| 427 | if ($end == '.') { |
|
| @@ 429-433 (lines=5) @@ | ||
| 426 | // Step 6d, 6f: remove "." and ".." from file portion |
|
| 427 | if ($end == '.') { |
|
| 428 | $path[] = ''; |
|
| 429 | } else if ($end == '..' && $path && $path[sizeof($path)-1] != '..') { |
|
| 430 | $path[sizeof($path)-1] = ''; |
|
| 431 | } else { |
|
| 432 | $path[] = $end; |
|
| 433 | } |
|
| 434 | // Step 6h |
|
| 435 | $base['path'] = join('/', $path); |
|
| 436 | ||