Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading font files from storage may not work when absolute paths are used #64

Open
saitho opened this issue Apr 10, 2024 · 1 comment
Open

Comments

@saitho
Copy link

saitho commented Apr 10, 2024

Just a small heads up: TYPO3 12.1 introduces a new feature in TypoScript setup to enforce absolute URLs.
config.forceAbsoluteUrls = 1

When loading fonts from file storage, there may be issues with this line, as getPublicUrl() then returns an absolute path: https://github.com/maikschneider/bw_captcha/blob/development/Classes/Utility/CaptchaBuilderUtility.php#L102

$randomFontFile = $resourceFactory->retrieveFileOrFolderObject($fontFiles[0])?->getPublicUrl() ?? '';
$randomFontFile = Environment::getPublicPath() . $randomFontFile;

We're currently enabling this feature, but are not using font files from storage. I just came across this when checking for side effects.

@maikschneider
Copy link
Owner

Hey @saitho, thank you very much for the warning! I will definitely look into this and implement a check.
Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants