Replaced functions with mb_* equivalents

main
Igor Scheller 6 years ago committed by msquare
parent 79c92da8c1
commit 8da8805f5d

@ -67,7 +67,7 @@ class RequestHandler implements MiddlewareInterface
*/ */
protected function resolveRequestHandler($handler) protected function resolveRequestHandler($handler)
{ {
if (is_string($handler) && strpos($handler, '@') !== false) { if (is_string($handler) && mb_strpos($handler, '@') !== false) {
list($class, $method) = explode('@', $handler, 2); list($class, $method) = explode('@', $handler, 2);
if (!class_exists($class) && !$this->container->has($class)) { if (!class_exists($class) && !$this->container->has($class)) {
$class = sprintf('Engelsystem\\Controllers\\%s', $class); $class = sprintf('Engelsystem\\Controllers\\%s', $class);

@ -29,6 +29,6 @@ class HtmlEngine implements EngineInterface
*/ */
public function canRender($path) public function canRender($path)
{ {
return strpos($path, '.htm') && file_exists($path); return mb_strpos($path, '.htm') !== false && file_exists($path);
} }
} }

@ -16,8 +16,8 @@ class TwigLoader extends FilesystemLoader
public function findTemplate($name, $throw = true) public function findTemplate($name, $throw = true)
{ {
$extension = '.twig'; $extension = '.twig';
$extensionLength = strlen($extension); $extensionLength = mb_strlen($extension);
if (substr($name, -$extensionLength, $extensionLength) !== $extension) { if (mb_substr($name, -$extensionLength, $extensionLength) !== $extension) {
$name .= $extension; $name .= $extension;
} }

@ -92,7 +92,7 @@ class MigrateTest extends TestCase
) { ) {
$contains = false; $contains = false;
foreach ($messages as $message) { foreach ($messages as $message) {
if (!Str::contains(strtolower($message), $type) || !Str::contains(strtolower($message), $value)) { if (!Str::contains(mb_strtolower($message), $type) || !Str::contains(mb_strtolower($message), $value)) {
continue; continue;
} }

Loading…
Cancel
Save