Skip to content

Commit b2a38ee

Browse files
[TASK] Use "PROJECT:" notation instead of "EXT:self" (#704)
1 parent db0214a commit b2a38ee

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/typo3-docs-theme/src/Directives/SiteSetSettingsDirective.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,22 @@ public function loadFileFromDocumentation(BlockContext $blockContext, Directive
8282
$pathPrefix = (string)$adapter->getPathPrefix();
8383

8484
// The path delivered via the directive like:
85-
// .. typo3:site-set-settings:: EXT:self/Configuration/Sets/FluidStyledContent/settings.definitions.yaml
85+
// .. typo3:site-set-settings:: PROJECT:/Configuration/Sets/FluidStyledContent/settings.definitions.yaml
8686
$setConfigurationFile = $directive->getData();
8787

8888
// By default, the RST files are placed inside a "Documentation" subdirectory.
8989
// When using the docker container, this origin root path is then set to "/project/Documentation".
9090
// No files on the "/project/" directory level can usually be accessed, even though they may belong
9191
// to TYPO3 core/third-party extensions that the Documentation belongs to directory-wise.
9292
// To allow files to be retrieved on the EXTENSION-level, instead of DOCUMENTATION-level,
93-
// a special string "EXT:self" is evaluated here.
93+
// a special string "PROJECT:" is evaluated here.
9494
// If a path starts with that notation, it will be referenced from the "/project/..." directory level.
9595
// It will not break out of the "/project/" mapping!
96-
if (str_starts_with($setConfigurationFile, 'EXT:self')) {
97-
// This will replace "EXT:self/Configuration/Sets/File.yaml" with "/Configuration/Sets/File.yaml"
96+
if (str_starts_with($setConfigurationFile, 'PROJECT:')) {
97+
// This will replace "PROJECT:/Configuration/Sets/File.yaml" with "/Configuration/Sets/File.yaml"
9898
// and is then passed to absoluteRelativePath() which will set $path = "/Configuration/Sets/File.yaml",
9999
// but ensure no "../../../" or other path traversal is allowed.
100-
$path = $parserContext->absoluteRelativePath(str_replace('EXT:self', '', $setConfigurationFile));
100+
$path = $parserContext->absoluteRelativePath(str_replace('PROJECT:', '', $setConfigurationFile));
101101

102102
// Get the current origin Path, usually "/project/Documentation/", and go one level up.
103103
$newOriginPath = dirname($pathPrefix) . '/';

tests/Integration/tests/site-set-ext-syntax/input/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Site Set Configuration
44
======================
55

6-
.. typo3:site-set-settings:: EXT:self/_root_include/settings.definitions.yaml
6+
.. typo3:site-set-settings:: PROJECT:/_root_include/settings.definitions.yaml
77
:name: fluid-styled-content
88
:type:
99
:Label:

tests/Integration/tests/site-set-failure/input/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Site Set Configuration
44
======================
55

6-
.. typo3:site-set-settings:: EXT:self/../../../tests/Integration/tests/site-set/input/_includes/Sets/FluidStyledContent/settings.definitions.yaml
6+
.. typo3:site-set-settings:: PROJECT:/../../../tests/Integration/tests/site-set/input/_includes/Sets/FluidStyledContent/settings.definitions.yaml
77
:name: fluid-styled-content
88
:type:
99
:Label:

0 commit comments

Comments
 (0)