friendsoftypo3 / jumpurl Goto Github PK
View Code? Open in Web Editor NEWExtension to enable redirects based on short links ("jump urls") to specific pages while keeping click statistics
License: GNU General Public License v2.0
Extension to enable redirects based on short links ("jump urls") to specific pages while keeping click statistics
License: GNU General Public License v2.0
Hello,
using jumpurl in a freshly updated typo3 installation throws warnings.
System configuration: jumpurl 8.0.3, typo3 11.5.17 and PHP 8.0.
Warning message: Core: Error handler (FE): PHP Warning: Undefined array key "jumpurl" in /www/htdocs/w0063ec2/cm3/typo3conf/ext/jumpurl/Classes/Middleware/JumpUrlHandler.php line 60
To me, the typecast in line 60 appears to be guilty.
Putting braces around the expression with the null coalescing operator removes the warnings.
$jumpUrl = (string) ( $request->getQueryParams()['jumpurl'] ?? '');
Kind regards
peter
Please link GitHub (code insights, issues, ...) pages in the TER: https://extensions.typo3.org/extension/jumpurl/
Since TYPO3 7.6.25 and 8.7.11 the [SYS][doNotCheckReferer]
configuration is removed.
See: https://docs.typo3.org/typo3cms/extensions/core/latest/Changelog/8.7.x/Important-83768-RemoveReferrerCheck.html
In current jumpurl version 7.1.1 the configuration is used for referrer check.
See: https://docs.typo3.org/typo3cms/extensions/jumpurl/Configuration/Index.html#typo3-conf-vars
Now the be log throws exception errors:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: The jumpUrl request was triggered by an illegal referrer. | RuntimeException thrown in file /.../typo3conf/ext/jumpurl/Classes/JumpUrlHandler.php in line 66. Requested URL: ...
Hi all,
A recently upgraded a typo3 6.2 LTS installation to 7.6 LTS and installed jumpurl because direct_mail seems to need it. Since this update the log show a lot of jumpurl errors:
Core: Exception handler (WEB): Uncaught TYPO3 Exception: #1359987599: The calculated Jump URL hash ("juHash") did not match the submitted "juHash" query parameter.
Exception thrown in file /.../typo3conf/ext/jumpurl/Classes/JumpUrlHandler.php in line 221.
Requested URL: http://augustana.de/aktuelles/ankuendigungen.html?jumpurl=http%3A%2F%2Fahs.dabis.cc
The link can be reached via a Dropdown in the header of all pages: "Quicklinks/Bibliothekskatalog"
When I click on that link the page opens without problems.
As far as I see those errors occur with links generated via typoscript.
I don't understand what makes those errors occur (since clicking in the frontend works) and how I can prevent them.
Any help appreciated,
Andrea
Hi,
In Typo3 11.5.16 and PHP8, if you first select a page in the pagetree and then click "Redirects" in the tool menu you get:
PHP Warning: Undefined array key "TSFE" in /var/www/typo3.sol.lu.se/typo3conf/ext/jumpurl/Classes/JumpUrlProcessor.php line 41
Not a huge problem but annoying. Changing line 41 to:
$this->frontendController = $typoScriptFrontendController ?? ($GLOBALS['TSFE'] ?? null);
solves the problem.
Kind regards
Tomas
Add typo3-ter/jumpurl to composer replace.
After updating to version 8.0 I get error on root page in page view backend:
Return value of FoT3\Jumpurl\JumpUrlProcessor::getTypoScriptFrontendController() must be an instance of TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController, null returned
downgrading to 7.8 solves this problem.
It seems that web crawlers make invalid requests on Jump URL addresses. As a result i get tons of system log entries every day.
The error comes from the redirect validation: https://github.com/FriendsOfTYPO3/jumpurl/blob/master/Classes/JumpUrlHandler.php#L221
Can you add an option to suppress this error to be logged? Or is this "expected behavior" and should only be logged as a info?
I would like to know when this plugin will be compatible with Typo 3 version 12?
Hallo dear friends of TYPO3,
I am updating a TYPO3 installation with direct mail. Direct mail depense on jump url, so I would like to ask, if you will provide a version für version 8.7 LTS. People longing for it:
e.g. Direct Mail Developers Comment
Thanks and regards :-)
Martin
I'm getting the following error when installing this extensions:
Service tag "event.listener" requires an event attribute to be defined, missing in: FoT3\Jumpurl\TypoLink\LinkModifier
extending Services.yaml with the line
event: FoT3\Jumpurl\TypoLink\LinkModifier
inside of event.listener solves the problem
Using jumpurl with TYPO3 7.6 it is not possible to get redirected to an external URL when jumpurl is enabled. File links on the other hand are working perfectly (with setting "secure = 1").
This is the exception thrown by TYPO3 for an external link:
#1294585194: The requested file was not allowed to be accessed through Jump URL. The path or file is not allowed.
I have added an additional condition to the JumpUrlProcessor::isEnabled() function on my own checking for links with context UrlProcessorInterface::CONTEXT_EXTERNAL and a globally disabled new option "config.jumpurl_external_disable". Calling this function with another parameter "url" from the process() function it is possible to disable the generation of jumpurl URLs for external links completely:
// If we have an external link and jumpurl is globally disabled for external links we disable it
if (
$context === UrlProcessorInterface::CONTEXT_EXTERNAL
&& $this->getTypoScriptFrontendController()->config['config']['jumpurl_external_disable']
) {
$enabled = false;
}
Would it be possible to add this new configuration parameter and functionality in a future version?
Following error occures:
Return value of FoT3\Jumpurl\JumpUrlProcessor::getTypoScriptFrontendController() must be an instance of TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController, null returned
Solution:
After changing lines in file jumpurl\Classes\JumpUrlProcessor.php after line 208:
protected function getTypoScriptFrontendController(): TypoScriptFrontendController
{
return $this->frontendController ?? $GLOBALS['TSFE'];
}
in
protected function getTypoScriptFrontendController()
{
return $this->frontendController ?? $GLOBALS['TSFE'];
}
everything works fine again.
If $GLOBALS[‘TYPO3_CONF_VARS’][‘FE’][‘compressionLevel’] is set the content-length header is send 0.
Hello,
we are using direct_mail for sending newsletters and jumpurl in footer links for unsubscribe, web-version etc.
When clicking on such a jumpurl in the newsletter we get an exception on the site saying:
str_replace(): Argument #2 ($replace) must be of type array|string, int given
We are using the following
Typo3 11.5.25
direct_mail 9.0.2
jumpurl 8.1.0
PHP 8.1.18
When switching back to PHP 7.4 the error doesn´t occur.
Can you please check the extension regarding PHP 8.1?
Thanks in advance
Stefanie
Hello!
Found in:
jumpurl/Classes/Middleware/JumpUrlHandler.php
Line 126 in 53bba6d
Using verifyFilenameAgainstDenyPattern raises an error in TYPO3 v11, this is the deprecation information:
https://docs.typo3.org/c/typo3/cms-core/main/en-us/Changelog/10.4/Deprecation-90147-UnifiedFileNameValidator.html
Kind regards,
Christian
Hello,we have found that jumpurl is notcompatible with TYPO3 9 : there are three calls to removed methods.
I would like to knowif there is any plan to fix this and if there is a timing.
In any case I and my colleagues could be in a position to contribute to this and I wonder if could be sensible to open a new branch for this.
Best regards
Hi
i'm trying to use the jumpurl.secure over a secured folder on nginx but it doesn't work.
i'm using fluid_styled_content.
the jumpurl redirect works, just the secure doesn't.
a quick debug show the secure parameter is not passed in the $configuration array.
maybe it's just i miss some TS.
config.jumpurl_enable = 1
config.jumpurl.secure = 1
Thanks
Hey,
im currently working on getting direct_mail
compatible with TYPO3 10 which depends on this package. Would love to see this getting ready for the upcoming 10 LTS version 🙂
TYPO3 10.4.1
redirects 10.4.1
jumpurl 8.0.0
PHP 7.4
Redirects with an external URL in field target throw the following error in backend module redirects:
(1/1) TypeError
Return value of FoT3\Jumpurl\JumpUrlProcessor::getTypoScriptFrontendController() must be an instance of TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController, null returned
in [...]/public/typo3conf/ext/jumpurl/Classes/JumpUrlProcessor.php line 208
protected function getTypoScriptFrontendController(): TypoScriptFrontendController
{
return $this->frontendController ?? $GLOBALS['TSFE'];
}
Hi,
On a composer typo3 v12 installation, i have this error when i index with typo3 solr :
1607172972: TYPO3\CMS\Frontend\ContentObject\Exception\ContentRenderingException: PSR-7 request is missing in ContentObjectRenderer. Inject with start(), setRequest() or provide via $GLOBALS['TYPO3_REQUEST'].
in vendor/typo3/cms-frontend/Classes/ContentObject/ContentObjectRenderer.php:5900
Stack trace:
#0 vendor/typo3/cms-frontend/Classes/Typolink/AbstractTypolinkBuilder.php(212): TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->getRequest()
#1 vendor/friendsoftypo3/jumpurl/Classes/TypoLink/LinkModifier.php(200): TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder->getTypoScriptFrontendController()
#2 vendor/friendsoftypo3/jumpurl/Classes/TypoLink/LinkModifier.php(118): FoT3\Jumpurl\TypoLink\LinkModifier->getTypoScriptFrontendController()
Not sure if it is totally linked to "jumpurl" or "solr".
Hi,
Jumpurl generates a warning in Typo3 11.5.15 and PHP 8. It's "typo3.sol.lu.se/typo3conf/ext/jumpurl/Classes/Middleware/JumpUrlHandler.php", line 60:
$jumpUrl = (string)$request->getQueryParams()['jumpurl'] ?? '';"
that generates a missing array key warning. Removing the (string) fixes the problem.
Kind regards
Tomas
TYPO3 11.5.26
PHP 8.1.18
jumpurl 8.1.0
Backend redirect module:
(1/1) #1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: Undefined global variable $TSFE in /var/www/html/private/typo3conf/ext/jumpurl/Classes/JumpUrlProcessor.php line 41
in /var/www/html/private/typo3/sysext/core/Classes/Error/ErrorHandler.php line 137
}
$message = self::ERROR_LEVEL_LABELS[$errorLevel] . ': ' . $errorMessage . ' in ' . $errorFile . ' line ' . $errorLine;
if ($errorLevel & $this->exceptionalErrors) {
throw new Exception($message, 1476107295);
}
$message = $this->getFormattedLogMessage($message);
at TYPO3\CMS\Core\Error\ErrorHandler->handleError(2, 'Undefined global variable $TSFE', '/var/www/html/private/typo3conf/ext/jumpurl/Classes/JumpUrlProcessor.php', 41)
in /var/www/html/private/typo3conf/ext/jumpurl/Classes/JumpUrlProcessor.php line 41
protected $frontendController;
public function __construct(TypoScriptFrontendController $typoScriptFrontendController = null, ContentObjectRenderer $contentObjectRenderer = null)
{
$this->frontendController = $typoScriptFrontendController ?? $GLOBALS['TSFE'];
$this->contentObjectRenderer = $contentObjectRenderer;
}
/**
at FoT3\Jumpurl\JumpUrlProcessor->__construct()
in /var/www/html/private/typo3/sysext/core/Classes/Utility/GeneralUtility.php line 3217
return self::$container->get($className);
}
// Create new instance and call constructor with parameters
$instance = new $finalClassName(...$constructorArguments);
// Register new singleton instance, but only if it is not a known PSR-11 container service
if ($instance instanceof SingletonInterface && !(self::$container !== null && self::$container->has($className))) {
self::$singletonInstances[$finalClassName] = $instance;
}
...
hey, I'm using the Solr and Jumpurl plugins. for indexing queues, solr uses a CLI command and I use this CLI command too. but unfortunately, I received this error "PSR-7 request is missing in ContentObjectRenderer. Inject with start(), setRequest() or provide via $GLOBALS['TYPO3_REQUEST']."
this error is a core error in typo3\sysext\frontend\Classes\ContentObject\ContentObjectRenderer.php file.it is beacuse that $GLOBALS['TYPO3_REQUEST'] and ServerRequestInterface are not set. actually in CLI command both of $GLOBALS['TYPO3_REQUEST'] and request will not set . I thought it was a bug from Solr but I saw this discussion at TYPO3-Solr/ext-solr#2973 and they have the following claim:
"When initializing the TSFE a TYPO3_REQUEST is also initialized. A request must always have an applicationtype attribute. If no applicationType is given ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST']) can't be used and throws an exception."
and they ask us If we have troubles with third-party code, we should give the hint to the maintainer of those extensions:
I added a little code in ext/jumpurl/Classes/TypoLink/LinkModifier.php(the error was here created) and checked if $GLOBALS['TYPO3_REQUEST'] set or not and after that, I could run the CLI command in solr without any errors. My solution was just a quick fix and surely you will have a more complete solution. I would be very grateful if you write a solution for this issue in new updates, I need your plugin :)
the following codes are :
use TYPO3\CMS\Core\Http\ApplicationType;
use TYPO3\CMS\Core\Http\ServerRequest;
public function __invoke(AfterLinkIsGeneratedEvent $event): void
{
if (($GLOBALS['TYPO3_REQUEST'] ?? null)instanceof ServerRequest && ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend())
{ (this if I used before I used your code)
if ($this->isEnabled($event)) {
$url = $event->getLinkResult()->getUrl();
$context = $event->getLinkResult()->getType();
$configuration = $event->getLinkResult()->getLinkConfiguration();
$this->contentObjectRenderer = $event->getContentObjectRenderer();
$this->frontendController = $this->contentObjectRenderer->getTypoScriptFrontendController();
// Strip the absRefPrefix from the URLs.
$urlPrefix = (string)$this->getTypoScriptFrontendController()->absRefPrefix;
if ($urlPrefix !== '' && str_starts_with($url, $urlPrefix)) {
$url = substr($url, strlen($urlPrefix));
}
// Make sure the slashes in the file URL are not encoded.
if ($context === LinkService::TYPE_FILE) {
$url = str_replace('%2F', '/', rawurlencode(rawurldecode($url)));
}
if ($context === LinkService::TYPE_PAGE && $url === '') {
$url = '/';
}
$urlParameters = ['jumpurl' => $url];
$jumpUrlConfig = $configuration['jumpurl.'] ?? [];
// see if a secure File URL should be built
if (!empty($jumpUrlConfig['secure'])) {
$secureParameters = $this->getParametersForSecureFile(
$url,
$jumpUrlConfig['secure.'] ?? []
);
$urlParameters = array_merge($urlParameters, $secureParameters);
} else {
$urlParameters['juHash'] = JumpUrlUtility::calculateHash($url);
}
$typoLinkConfiguration = [
'parameter' => $this->getTypoLinkParameter($jumpUrlConfig),
'additionalParams' => GeneralUtility::implodeArrayForUrl('', $urlParameters),
];
$jumpurl = $this->getContentObjectRenderer()->typoLink_URL($typoLinkConfiguration);
// Now add the prefix again if it was not added by a typolink call already.
if ($urlPrefix !== '') {
if (!str_starts_with($jumpurl, $urlPrefix)) {
$jumpurl = $urlPrefix . $jumpurl;
}
if (!str_starts_with($url, $urlPrefix)) {
$url = $urlPrefix . $url;
}
}
$event->setLinkResult($event->getLinkResult()->withAttributes(['href' => $jumpurl, 'jumpurl' => $url]));
}
}
If I have a backend module which generates typolinks, for example via fluid template:
<f:link.typolink parameter="{target}" />
and have EXT:jumpurl installed, I end up with an Exception when running with PHP 8:
#1476107295 TYPO3\CMS\Core\Error\Exception
PHP Warning: Undefined global variable $TSFE in /app/html/typo3conf/ext/jumpurl/Classes/JumpUrlProcessor.php line 41
...
in /app/html/typo3conf/ext/jumpurl/Classes/JumpUrlProcessor.php line 41
This happens in the registered typolink hook ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['urlProcessing']['urlProcessors']
).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.