68 public function checkLink($url, $softRefEntry, $reference)
71 $this->responseContent =
true;
73 unset($this->errorParams);
76 [$table, $uid] = explode(
':', $softRefEntry[
'substr'][
'recordRef']);
77 if (!in_array($table, [
'pages',
'tt_content'],
true)) {
81 if (strpos($url,
'#c') !==
false) {
82 $parts = explode(
'#c', $url);
86 $table ===
'tt_content'
87 && strpos($softRefEntry[
'row'][$softRefEntry[
'field']],
't3://') === 0
89 $parsedTypoLinkUrl = @parse_url($softRefEntry[
'row'][$softRefEntry[
'field']]);
90 if ($parsedTypoLinkUrl[
'host'] ===
'page') {
91 parse_str($parsedTypoLinkUrl[
'query'], $query);
92 if (isset($query[
'uid'])) {
93 $page = (int)$query[
'uid'];
101 $this->responsePage = $this->
checkPage($page);
105 $this->responseContent = $this->
checkContent($page, $anchor);
108 is_array($this->errorParams[
'page']) && !$this->responsePage
109 || is_array($this->errorParams[
'content']) && !$this->responseContent
126 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(
'pages');
127 $queryBuilder->getRestrictions()->removeAll();
129 ->select(
'uid',
'title',
'deleted',
'hidden',
'starttime',
'endtime')
132 $queryBuilder->expr()->eq(
134 $queryBuilder->createNamedParameter($page, \PDO::PARAM_INT)
139 $this->responsePage =
true;
141 if ($row[
'deleted'] ==
'1') {
143 $this->errorParams[
'page'][
'title'] = $row[
'title'];
144 $this->errorParams[
'page'][
'uid'] = $row[
'uid'];
145 $this->responsePage =
false;
146 } elseif ($row[
'hidden'] ==
'1'
147 ||
$GLOBALS[
'EXEC_TIME'] < (
int)$row[
'starttime']
148 || $row[
'endtime'] && (
int)$row[
'endtime'] <
$GLOBALS[
'EXEC_TIME']
151 $this->errorParams[
'page'][
'title'] = $row[
'title'];
152 $this->errorParams[
'page'][
'uid'] = $row[
'uid'];
153 $this->responsePage =
false;
157 $this->errorParams[
'page'][
'uid'] = (int)$page;
158 $this->responsePage =
false;
173 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(
'tt_content');
174 $queryBuilder->getRestrictions()->removeAll();
176 ->select(
'uid',
'pid',
'header',
'deleted',
'hidden',
'starttime',
'endtime')
179 $queryBuilder->expr()->eq(
181 $queryBuilder->createNamedParameter($anchor, \PDO::PARAM_INT)
186 $this->responseContent =
true;
191 $correctPageID = (int)$row[
'pid'];
194 if ($correctPageID !== $page) {
195 $this->errorParams[
'errorType'][
'content'] =
self::MOVED;
196 $this->errorParams[
'content'][
'uid'] = (int)$anchor;
197 $this->errorParams[
'content'][
'wrongPage'] = $page;
198 $this->errorParams[
'content'][
'rightPage'] = $correctPageID;
199 $this->responseContent =
false;
202 if ($row[
'deleted'] ==
'1') {
204 $this->errorParams[
'content'][
'title'] = $row[
'header'];
205 $this->errorParams[
'content'][
'uid'] = $row[
'uid'];
206 $this->responseContent =
false;
207 } elseif ($row[
'hidden'] ==
'1' ||
$GLOBALS[
'EXEC_TIME'] < (
int)$row[
'starttime'] || $row[
'endtime'] && (
int)$row[
'endtime'] <
$GLOBALS[
'EXEC_TIME']) {
209 $this->errorParams[
'content'][
'title'] = $row[
'header'];
210 $this->errorParams[
'content'][
'uid'] = $row[
'uid'];
211 $this->responseContent =
false;
217 $this->errorParams[
'content'][
'uid'] = (int)$anchor;
218 $this->responseContent =
false;
234 switch ($errorType[
'page']) {
236 $errorPage = str_replace(
245 $lang->getLL(
'list.report.pagedeleted')
249 $errorPage = str_replace(
258 $lang->getLL(
'list.report.pagenotvisible')
262 $errorPage = str_replace(
265 $lang->getLL(
'list.report.pagenotexisting')
270 switch ($errorType[
'content']) {
272 $errorContent = str_replace(
281 $lang->getLL(
'list.report.contentdeleted')
285 $errorContent = str_replace(
294 $lang->getLL(
'list.report.contentnotvisible')
298 $errorContent = str_replace(
311 $lang->getLL(
'list.report.contentmoved')
315 $errorContent = str_replace(
'###uid###',
$errorParams[
'content'][
'uid'], $lang->getLL(
'list.report.contentnotexisting'));
318 if (isset($errorPage) && isset($errorContent)) {
319 $response = $errorPage . LF . $errorContent;
320 } elseif (isset($errorPage)) {
321 $response = $errorPage;
322 } elseif (isset($errorContent)) {
323 $response = $errorContent;
326 $response = $lang->getLL(
'list.report.noinformation');
339 $domain = rtrim(GeneralUtility::getIndpEnv(
'TYPO3_SITE_URL'),
'/');
342 if (!empty($rootLine)) {
343 $protocol = GeneralUtility::getIndpEnv(
'TYPO3_SSL') ?
'https://' :
'http://';
345 if (!empty($domainRecord)) {
346 $domain = $protocol . $domainRecord;
349 return $domain .
'/index.php?id=' . $row[
'url'];