Gère davantage de cas dans le routeur

This commit is contained in:
2022-11-22 08:40:05 +01:00
parent 9bc53b958f
commit 86827d1983
2 changed files with 29 additions and 7 deletions

View File

@@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace Silex\Router;
final class PathHelper
{
public static function removeEverythingAfter(string $str, string $char): string
{
$pos = strpos($str, $char);
if ($pos !== false) {
return substr($str, 0, $pos);
}
return $str;
}
}