Skip to content

Commit 236017d

Browse files
derrabusnicolas-grekas
authored andcommitted
Leverage str_contains/str_starts_with
Signed-off-by: Alexander M. Turek <me@derrabus.de>
1 parent de282c9 commit 236017d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

EventListener/WebDebugToolbarListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public function onKernelResponse(FilterResponseEvent $event)
101101
if (self::DISABLED === $this->mode
102102
|| !$response->headers->has('X-Debug-Token')
103103
|| $response->isRedirection()
104-
|| ($response->headers->has('Content-Type') && false === strpos($response->headers->get('Content-Type'), 'html'))
104+
|| ($response->headers->has('Content-Type') && !str_contains($response->headers->get('Content-Type'), 'html'))
105105
|| 'html' !== $request->getRequestFormat()
106106
|| false !== stripos($response->headers->get('Content-Disposition', ''), 'attachment;')
107107
) {

Twig/WebProfilerExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public function dumpLog(Environment $env, $message, Data $context = null)
9898
$message = twig_escape_filter($env, $message);
9999
$message = preg_replace('/&quot;(.*?)&quot;/', '&quot;<b>$1</b>&quot;', $message);
100100

101-
if (null === $context || false === strpos($message, '{')) {
101+
if (null === $context || !str_contains($message, '{')) {
102102
return '<span class="dump-inline">'.$message.'</span>';
103103
}
104104

0 commit comments

Comments
 (0)