Review 10.4 Merged

66919[TASK] Introduce constant 'TYPO3'

Christian Kuhn CR +2 V +2 Easy +6 −0 updated 11/28/20, 18:00

Commit message

TYPO3 still has some script files that run in global scope
without class or callable encapsulation. Those are especially
ext_localconf.php, ext_tables.php and Configuration/TCA/Overrides/*
script files.

When those files are located within document root, they can be
called directly via HTTP and may output something, which can be
a security risk. To prevent this, they have a call at the very
start: 'defined('TYPO3_MODE') or die();'.

Unfortunately, constant 'TYPO3_MODE' is a technical debt, core
tries to phase it out in v11. We thus need something equivalent
for these calls.

Since that test for existance of a constant is so simple and
straight forward, the solution is to define a new constant to
true, simply named 'TYPO3', to substitute 'TYPO3_MODE'. The
call is very similar: 'defined('TYPO3') or die();'.

The patch targets core master and v10: Having that constant in
v10 simplifies life of extension developers who want to deliver
extensions compatible with v10 and v11 in the same version, when
'TYPO3_MODE' constant is deprecated in v11 with upcoming patches.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
  • Verified V +2 Done
    • Christian Kuhn +2
    • TYPO3com +1 CI

Issues 2

Files 1

Review log 45

  1. Christian Kuhn commented on patch set 1 11/28/20, 17:36

    Cherry Picked from branch master.
  2. TYPO3com voted on patch set 1 V +1 11/28/20, 17:47 Completed build in 10m 32s on Sat, 28 Nov, 05:47 PM Test Summary: 75183 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC104-846

  3. Christian Kuhn voted on patch set 1 V +2 CR +2 11/28/20, 17:58

  4. Christian Kuhn merged patch set 2 11/28/20, 17:58

  5. Georg Ringer commented on patch set 2 11/28/20, 18:00

    would still be nice to have a rst for that. I see that as feature and great to have that in 10