Bug #84167
closed
Negation Bug in TYPO3 8.7 GuzzleHttp \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl()
Added by Felix Buenemann over 6 years ago.
Updated about 6 years ago.
Description
There's a negation bug in \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl() of TYPO3 8.7.10 that was introduced when the code was converted from curl to GuzzleHttp (see #70056).
The code replaced a check for $content === false
in the curl code with !empty($content)
in the GuzzleHttp code, which has the consequence of all reponses with a non-empty body being handled like an error and as a result missing the http_code
and content_type
field in the report.
The bug was introduced in revision 68a6da69a401e083dca1a9e7d368560a52ec0f68 check line 2111 in the old and 2055 in the new code.
The attached patch against the master branch should fix the problem and applies just fine to the 8.7 branch with a line offset.
Files
- Subject changed from Negation Bug in TYPO3 8.7 GuttzleHttp \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl() to Negation Bug in TYPO3 8.7 GuzzleHttp \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl()
- Status changed from New to Needs Feedback
- Assignee set to Mathias Schreiber
Would you mind pushing a change?
I can do it too, but then all the credit goes to me while you found the issue in the first place
Mathias: Do you mean a PR against the TYPO3-CMS/core Github Repo or where should I direct it?
You can also use git apply <patchfile>
which should retain the author and commit message (you would be listed as committer, me as the author).
Sorry, I meant git am
not apply
.
I'll test whether that thing applies on master, too
It should, since the patch is against master from a few minutes ago. Offset in 8.7 is 237 lines or so.
- Related to Bug #84170: Inconsistent lib value in \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl() since GuzzleHttp switch added
The file does not apply.
I think this is mainly because it's taken from somewhere within the file structure, not from TYPO3's root dir.
In order to rule out any errors on my side:
git am /Volumes/Macintosh\ HD/Users/mathiasschreiber/Downloads/0001-BUGFIX-Negation-bug-in-getUrl-empty-body-check.patch
Applying: Negation bug in getUrl empty body check
error: Classes/Utility/GeneralUtility.php: does not exist in index
Patch failed at 0001 Negation bug in getUrl empty body check
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Tried both from the git root as well as from typo3/sysext/core
- File deleted (
0001-BUGFIX-Negation-bug-in-getUrl-empty-body-check.patch)
I updated the paths in the patch so that it applies against the main TYPO3.CMS git repo.
All right I'll look at the guide. I remember using Gerrit once some years ago and I found the interface very confusing to say the least.
Anyways I'll follow the guide and post an update once done.
I can walk you through it via Voice if you like as well.
Hit me up on Slack when you find the time.
- Status changed from Needs Feedback to Under Review
Followup:
I applied the patch on master and added the necessary info to the commit message.
We'll need to change the commit message around a little bit... just follow the review mentioned in this ticket
Yeah, I noticed that git am
drops all prefixes in brackets, that's counterproductive here. I'll follow the gerrit workflow directly for the next ticket.
- Related to Bug #84173: TYPO3 8.7 GuzzleHttp \TYPO3\CMS\Core\Utility\GeneralUtility::getUrl() returns content_type as array instead of string added
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
- Status changed from Resolved to Closed
Also available in: Atom
PDF