Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Throw dedicated exception for invalid request URL on CLI
Usage of ServerRequestFactory::fromGlobals() on CLI is discouraged as the request url, used to create the request is invalid, except the $_SERVER variable is adjusted beforehand. To properly inform the developer, a dedicated exception is now being thrown, if in CLI context. Resolves: #102533 Releases: main, 12.4 Change-Id: Ie84fdf9c0555eeeaf5438a2ed29acabbe2755965 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82015 Tested-by: Oliver Bartsch <bo@cedev.de> Tested-by: core-ci <typo3@b13.com> Reviewed-by: Oliver Bartsch <bo@cedev.de>
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
typo3/sysext/core/Classes/Http/InvalidRequestUrlOnCliException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of the TYPO3 CMS project. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE.txt file that was distributed with this source code. | ||
* | ||
* The TYPO3 project - inspiring people to share! | ||
*/ | ||
|
||
namespace TYPO3\CMS\Core\Http; | ||
|
||
/** | ||
* Exception is thrown in case an invalid request url is used in CLI context | ||
* | ||
* @internal | ||
*/ | ||
class InvalidRequestUrlOnCliException extends \InvalidArgumentException {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters