Code Duplication    Length = 14-20 lines in 2 locations

typo3/sysext/frontend/Classes/Page/PageRepository.php 1 location

@@ 1630-1649 (lines=20) @@
1627
                $moveID = $row['t3ver_move_id'];
1628
            }
1629
            // Find pointed-to record.
1630
            if ($moveID) {
1631
                $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
1632
                $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class));
1633
                $origRow = $queryBuilder->select(...array_keys($this->purgeComputedProperties($row)))
1634
                    ->from($table)
1635
                    ->where(
1636
                        $queryBuilder->expr()->eq(
1637
                            'uid',
1638
                            $queryBuilder->createNamedParameter($moveID, \PDO::PARAM_INT)
1639
                        )
1640
                    )
1641
                    ->setMaxResults(1)
1642
                    ->execute()
1643
                    ->fetch();
1644
1645
                if ($origRow) {
1646
                    $row = $origRow;
1647
                    return true;
1648
                }
1649
            }
1650
        }
1651
        return false;
1652
    }

typo3/sysext/core/Classes/DataHandling/DataHandler.php 1 location

@@ 6915-6928 (lines=14) @@
6912
    protected function recordInfoWithPermissionCheck(string $table, int $id, $perms, string $fieldList = '*')
6913
    {
6914
        $id = (int)$id;
6915
        if ($this->bypassAccessCheckForRecords) {
6916
            $columns = GeneralUtility::trimExplode(',', $fieldList, true);
6917
6918
            $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table);
6919
            $queryBuilder->getRestrictions()->removeAll();
6920
6921
            $record = $queryBuilder->select(...$columns)
6922
                ->from($table)
6923
                ->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($id, \PDO::PARAM_INT)))
6924
                ->execute()
6925
                ->fetch();
6926
6927
            return $record ?: false;
6928
        }
6929
        // Processing the incoming $perms (from possible string to integer that can be AND'ed)
6930
        if (!MathUtility::canBeInterpretedAsInteger($perms)) {
6931
            if ($table !== 'pages') {