| @@ 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') { |
|
| @@ 1642-1661 (lines=20) @@ | ||
| 1639 | $moveID = $row['t3ver_move_id']; |
|
| 1640 | } |
|
| 1641 | // Find pointed-to record. |
|
| 1642 | if ($moveID) { |
|
| 1643 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($table); |
|
| 1644 | $queryBuilder->setRestrictions(GeneralUtility::makeInstance(FrontendRestrictionContainer::class)); |
|
| 1645 | $origRow = $queryBuilder->select(...array_keys($this->purgeComputedProperties($row))) |
|
| 1646 | ->from($table) |
|
| 1647 | ->where( |
|
| 1648 | $queryBuilder->expr()->eq( |
|
| 1649 | 'uid', |
|
| 1650 | $queryBuilder->createNamedParameter($moveID, \PDO::PARAM_INT) |
|
| 1651 | ) |
|
| 1652 | ) |
|
| 1653 | ->setMaxResults(1) |
|
| 1654 | ->execute() |
|
| 1655 | ->fetch(); |
|
| 1656 | ||
| 1657 | if ($origRow) { |
|
| 1658 | $row = $origRow; |
|
| 1659 | return true; |
|
| 1660 | } |
|
| 1661 | } |
|
| 1662 | } |
|
| 1663 | return false; |
|
| 1664 | } |
|