Fix some edge case.
This commit is contained in:
parent
2a7b1b1f0d
commit
4f9a298273
1 changed files with 2 additions and 1 deletions
|
@ -52,7 +52,8 @@ class Util {
|
|||
|
||||
public static function ends_with($sequence, $tail) {
|
||||
|
||||
return substr($sequence, -strlen($tail)) === $tail;
|
||||
$len = strlen($tail);
|
||||
return $len === 0 ? true : substr($sequence, -$len) === $tail;
|
||||
}
|
||||
|
||||
public static function wrap_pattern($pattern) {
|
||||
|
|
Loading…
Add table
Reference in a new issue