| @@ 73-83 (lines=11) @@ | ||
| 70 | * |
|
| 71 | * @return string |
|
| 72 | */ |
|
| 73 | public static function endSlash($path, $trim = false) { |
|
| 74 | if (substr($path, -1) !== '/') { |
|
| 75 | $path .= '/'; |
|
| 76 | } |
|
| 77 | ||
| 78 | if ($trim) { |
|
| 79 | $path = trim($path); |
|
| 80 | } |
|
| 81 | ||
| 82 | return $path; |
|
| 83 | } |
|
| 84 | ||
| 85 | ||
| 86 | /** |
|
| @@ 92-102 (lines=11) @@ | ||
| 89 | * |
|
| 90 | * @return string |
|
| 91 | */ |
|
| 92 | public static function noEndSlash($path, $trim = false) { |
|
| 93 | if (substr($path, -1) === '/') { |
|
| 94 | $path = substr($path, 0, -1); |
|
| 95 | } |
|
| 96 | ||
| 97 | if ($trim) { |
|
| 98 | $path = trim($path); |
|
| 99 | } |
|
| 100 | ||
| 101 | return $path; |
|
| 102 | } |
|
| 103 | ||
| 104 | ||
| 105 | /** |
|
| @@ 111-121 (lines=11) @@ | ||
| 108 | * |
|
| 109 | * @return string |
|
| 110 | */ |
|
| 111 | public static function noBeginSlash($path, $trim = false) { |
|
| 112 | if (substr($path, 0, 1) === '/') { |
|
| 113 | $path = substr($path, 1); |
|
| 114 | } |
|
| 115 | ||
| 116 | if ($trim) { |
|
| 117 | $path = trim($path); |
|
| 118 | } |
|
| 119 | ||
| 120 | return $path; |
|
| 121 | } |
|
| 122 | ||
| 123 | ||
| 124 | public static function secureUsername($username) { |
|