diff --git a/lib/RoadizCoreBundle/src/Repository/NodesSourcesRepository.php b/lib/RoadizCoreBundle/src/Repository/NodesSourcesRepository.php index a8e3faef..2892828a 100644 --- a/lib/RoadizCoreBundle/src/Repository/NodesSourcesRepository.php +++ b/lib/RoadizCoreBundle/src/Repository/NodesSourcesRepository.php @@ -272,7 +272,7 @@ protected function getContextualQuery( // Add ordering if (null !== $orderBy) { foreach ($orderBy as $key => $value) { - if (false !== \mb_strpos($key, 'node.')) { + if (\str_contains($key, 'node.')) { $simpleKey = str_replace('node.', '', $key); $qb->addOrderBy(static::NODE_ALIAS . '.' . $simpleKey, $value); } else { @@ -653,7 +653,7 @@ protected function prepareComparisons(array &$criteria, QueryBuilder $qb, $alias if (!$event->isPropagationStopped()) { $baseKey = $simpleQB->getParameterKey($key); - if (false !== \mb_strpos($key, 'node.nodeType.')) { + if (\str_contains($key, 'node.nodeType.')) { if (!$this->hasJoinedNode($qb, $alias)) { $qb->innerJoin($alias . '.node', static::NODE_ALIAS); } @@ -663,7 +663,7 @@ protected function prepareComparisons(array &$criteria, QueryBuilder $qb, $alias $prefix = static::NODETYPE_ALIAS . '.'; $simpleKey = str_replace('node.nodeType.', '', $key); $qb->andWhere($simpleQB->buildExpressionWithoutBinding($value, $prefix, $simpleKey, $baseKey)); - } elseif (false !== \mb_strpos($key, 'node.')) { + } elseif (\str_contains($key, 'node.')) { if (!$this->hasJoinedNode($qb, $alias)) { $qb->innerJoin($alias . '.node', static::NODE_ALIAS); } diff --git a/lib/RoadizCoreBundle/src/Repository/TagRepository.php b/lib/RoadizCoreBundle/src/Repository/TagRepository.php index 6f8c1f17..d92c8655 100644 --- a/lib/RoadizCoreBundle/src/Repository/TagRepository.php +++ b/lib/RoadizCoreBundle/src/Repository/TagRepository.php @@ -608,19 +608,19 @@ protected function prepareComparisons(array &$criteria, QueryBuilder $qb, $alias // Dots are forbidden in field definitions $baseKey = $simpleQB->getParameterKey($key); - if (false !== \mb_strpos($key, 'translation.')) { + if (\str_contains($key, 'translation.')) { /* * Search in translation fields */ $prefix = static::TRANSLATION_ALIAS . '.'; $key = str_replace('translation.', '', $key); - } elseif (false !== \mb_strpos($key, 'nodes.')) { + } elseif (\str_contains($key, 'nodes.')) { /* * Search in node fields */ $prefix = static::NODE_ALIAS . '.'; $key = str_replace('nodes.', '', $key); - } elseif (false !== \mb_strpos($key, 'translatedTag.')) { + } elseif (\str_contains($key, 'translatedTag.')) { /* * Search in translatedTags fields */