Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sg_routes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TYPO3
sg_routes
Merge requests
!19
Couldn't fetch the linked file.
Release 5.0.0
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Release 5.0.0
release_5.0.0
into
master
Overview
0
Commits
9
Changes
3
Merged
Georgi
requested to merge
release_5.0.0
into
master
3 years ago
Overview
0
Commits
9
Changes
3
Expand
0
0
Merge request reports
Viewing commit
9d00dcc3
Prev
Next
Show latest version
3 files
+
11
−
104
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
9d00dcc3
[BUGFIX] Remove totally stupid frontend link resolver code
· 9d00dcc3
Stefan Galinski
authored
3 years ago
Classes/Middleware/FrontendLinkResolver.php deleted
100644 → 0
+
0
−
79
Options
<?php
namespace
SGalinski\SgRoutes\Middleware
;
/**
*
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
*/
use
Psr\Http\Message\ResponseInterface
;
use
Psr\Http\Message\ServerRequestInterface
;
use
Psr\Http\Server\MiddlewareInterface
;
use
Psr\Http\Server\RequestHandlerInterface
;
use
SGalinski\SgRoutes\Service\DemoModeService
;
use
SGalinski\SgRoutes\Service\LicenceCheckService
;
use
TYPO3\CMS\Core\Http\Response
;
use
TYPO3\CMS\Core\Utility\GeneralUtility
;
use
TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer
;
/**
* Resolver for generating frontend links
*
* @package SGalinski\SgRoutes\Middleware
* @author Kevin Ditscheid <kevin.ditscheid@sgalinski.de>
*/
class
FrontendLinkResolver
implements
MiddlewareInterface
{
/**
* Process an incoming server request.
*
* Processes an incoming server request in order to produce a response.
* If unable to produce the response itself, it may delegate to the provided
* request handler to do so.
*/
public
function
process
(
ServerRequestInterface
$request
,
RequestHandlerInterface
$handler
):
ResponseInterface
{
if
(
!
LicenceCheckService
::
hasValidLicense
()
&&
!
DemoModeService
::
isInDemoMode
())
{
return
$handler
->
handle
(
$request
);
}
$queryParams
=
$request
->
getQueryParams
();
if
(
!
isset
(
$queryParams
[
'tx_sgroutes_frontendlink'
]))
{
return
$handler
->
handle
(
$request
);
}
$contentObjectRenderer
=
GeneralUtility
::
makeInstance
(
ContentObjectRenderer
::
class
);
$response
=
new
Response
();
$response
->
getBody
()
->
write
(
$contentObjectRenderer
->
typoLink
(
''
,
[
'parameter'
=>
$queryParams
[
'tx_sgroutes_frontendlink'
][
'destination_url'
],
'returnLast'
=>
'url'
]
)
);
return
$response
;
}
}
Loading