| Conditions | 4 |
| Paths | 6 |
| Total Lines | 13 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 17 | public static function normalizerPath($path, $isfolder = False) |
||
| 18 | { |
||
| 19 | if (preg_match('/^\//', $path) == 0) { |
||
| 20 | $path = '/' . $path; |
||
| 21 | } |
||
| 22 | if ($isfolder == True) { |
||
| 23 | if (preg_match('/\/$/', $path) == 0) { |
||
| 24 | $path = $path . '/'; |
||
| 25 | } |
||
| 26 | } |
||
| 27 | // Remove unnecessary slashes. |
||
| 28 | $path = preg_replace('#/+#', '/', $path); |
||
| 29 | return $path; |
||
| 30 | } |
||
| 31 | } |