getkirby-v2/toolkit

str::after() with not-found needle omits first char

sebsel opened this issue · 1 comments

So I had the following:

echo str::after('string', '.');
// tring

Maybe add a if (!$pos) return $string?

  public static function after($string, $char) {
    $pos = strpos($string, $char);
    return static::substr($string, $pos+1);
  }

This is now fixed on the develop branch.