Skip to content

Commit 2a75ac1

Browse files
author
Ante Prkacin
committed
NGSTACK-1000 replace 'mb_strpos' with 'str_starts_with' method in Image fieldType handler
1 parent bb09945 commit 2a75ac1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

bundle/Handler/FieldType/Image.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Symfony\Component\HttpFoundation\RequestStack;
1818

1919
use function ltrim;
20-
use function mb_strpos;
2120

2221
final class Image extends Handler
2322
{
@@ -40,7 +39,7 @@ protected function getFieldValue(Field $field, string $tagName, array $params =
4039
try {
4140
$variationUri = $this->imageVariationService->getVariation($field, $this->content->getVersionInfo(), $variationName)->uri;
4241

43-
if (mb_strpos($variationUri, '/') === 0 && ($request = $this->requestStack->getCurrentRequest()) !== null) {
42+
if (str_starts_with($variationUri, '/') && ($request = $this->requestStack->getCurrentRequest()) !== null) {
4443
$variationUri = $request->getUriForPath('/' . ltrim($variationUri, '/'));
4544
}
4645

0 commit comments

Comments
 (0)