Project

General

Profile

Actions

Bug #98995

closed

Undefined array key "SYS_LASTCHANGED" in ContentObjectRenderer.php:1189

Added by Christian Toffolo over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2022-11-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Here in method 'lastChanged'

(int)$tsfe->register['SYS_LASTCHANGED'])
should be:
(int)($tsfe->register['SYS_LASTCHANGED'] ?? 0)
?

Actions #1

Updated by Chris Müller over 1 year ago

Can you give the scenario when the error occurs? Ideally, also a stack trace?

Actions #2

Updated by Christian Toffolo over 1 year ago

Also here should be:
(int)($this->register['SYS_LASTCHANGED'] ?? 0)

Actions #3

Updated by Christian Toffolo over 1 year ago

To reproduce it, try to visit a page not already cached with a request like the ones from Google Bot with a code like:

<?php
declare(strict_types=1);

googleBot('http://acme.com/');
echo "done";

/**
 * @param $url
 * @return bool|string
 */
function googleBot($url): bool|string
{
    $header = [];
    $header[] = 'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5';
    $header[] = 'Cache-Control: max-age=0';
    $header[] = 'Content-Type: text/html; charset=utf-8';
    $header[] = 'Transfer-Encoding: chunked';
    $header[] = 'Connection: keep-alive';
    $header[] = 'Keep-Alive: 300';
    $header[] = 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7';
    $header[] = 'Accept-Language: en-us,en;q=0.5';
    $header[] = 'Pragma:';

    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.5249.119 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)');
    curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
    curl_setopt($curl, CURLOPT_REFERER, 'http://www.google.com');
    curl_setopt($curl, CURLOPT_ENCODING, 'gzip, deflate');
    curl_setopt($curl, CURLOPT_AUTOREFERER, true);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_TIMEOUT, 10);
    $body = curl_exec($curl);
    curl_close($curl);
    return $body;
}
Actions #4

Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77329

Actions #5

Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77329

Actions #6

Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch 11.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/77333

Actions #7

Updated by Christian Kuhn over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF