Skip to content

Commit 4fa5cb4

Browse files
Merge branch '7.4' into 8.0
* 7.4: Use phpunit attribute Remove some implicit bool type juggling [Scheduler] Fix `scheduler.task` tag arguments optionality use false instead of null to hide the currency symbol [FrameworkBundle] Fix block type from `OK` to `ERROR` when local vault is disabled in `SecretsRemoveCommand` run tests with PHPUnit 12.1 on PHP >= 8.3 Fix wrong boolean values minor #61328 [FrameworkBundle] Decouple ControllerResolverTest from HttpKernel (nicolas-grekas) [Messenger] Fix NoAutoAckStamp handling in Worker::flush() [DependencyInjection] Dump XML using plain PHP, no DOM needed
2 parents dc30cab + 08587b6 commit 4fa5cb4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

UnicodeString.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ public function endsWith(string|iterable|AbstractString $suffix): bool
106106
return false;
107107
}
108108

109+
$grapheme = grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)) ?: '';
110+
109111
if ($this->ignoreCase) {
110-
return 0 === mb_stripos(grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)), $suffix, 0, 'UTF-8');
112+
return 0 === mb_stripos($grapheme, $suffix, 0, 'UTF-8');
111113
}
112114

113-
return $suffix === grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix));
115+
return $suffix === $grapheme;
114116
}
115117

116118
public function equalsTo(string|iterable|AbstractString $string): bool
@@ -355,11 +357,13 @@ public function startsWith(string|iterable|AbstractString $prefix): bool
355357
return false;
356358
}
357359

360+
$grapheme = grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES) ?: '';
361+
358362
if ($this->ignoreCase) {
359-
return 0 === mb_stripos(grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES), $prefix, 0, 'UTF-8');
363+
return 0 === mb_stripos($grapheme, $prefix, 0, 'UTF-8');
360364
}
361365

362-
return $prefix === grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES);
366+
return $prefix === $grapheme;
363367
}
364368

365369
public function __wakeup(): void

0 commit comments

Comments
 (0)