Bug #69368
closedeID not recognized on POST requests
100%
Description
The problem seems to be in lines 111 to 113 in typo3/sysext/frontend/Classes/Http/EidRequestHandler.php:
$eID = isset($request->getParsedBody()['eID']) ? $request->getParsedBody()['eID'] : isset($request->getQueryParams()['eID']) ? $request->getQueryParams()['eID'] : '';
isset($request->getParsedBody()['eID'])
condition seams to be negative but $request->getParsedBody()['eID']
would return content. Maybe a bug in PHP, but at last it's not working for me.
Changing the lines to:
$eID = $request->getParsedBody()['eID']; if (!isset($eID)) { $eID = isset($request->getQueryParams()['eID']) ? $request->getQueryParams()['eID'] : ''; }
works.
I'm using TYPO3 7.4.0 with self-compiled PHP 5.6.12 on a Debian Jessie (Also tested with 5.5.28 with same result).
Updated by Markus Klein over 9 years ago
- Description updated (diff)
- Category set to Backend API
- Priority changed from -- undefined -- to Must have
- Target version set to 7.5
Updated by Markus Klein over 9 years ago
If this is the case, then this must be a PHP bug.
So we must change many places, where we use the same syntax. Can you maybe search whether this is a known bug, please?
Updated by Markus Klein over 9 years ago
One more question. Does this work for you?
$eID = isset($request->getParsedBody()['eID']) ? $request->getParsedBody()['eID'] : (isset($request->getQueryParams()['eID']) ? $request->getQueryParams()['eID'] : '');
Mind the additional parenthesis.
Updated by Markus Klein over 9 years ago
Ok the issue is indeed operator precedence.
From the PHP docs
// ternary operator associativity differs from C/C++ $a = true ? 0 : true ? 1 : 2; // (true ? 0 : true) ? 1 : 2 = 2
Updated by Petra Arentzen over 9 years ago
Markus Klein wrote:
One more question. Does this work for you?
[...]
Mind the additional parenthesis.
Yes, that it. Argh, not seen that …
Updated by Gerrit Code Review over 9 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42891
Updated by Markus Klein over 9 years ago
- Complexity set to easy
- Is Regression changed from No to Yes
- Sprint Focus set to Stabilization Sprint
Updated by Gerrit Code Review over 9 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42891
Updated by Gerrit Code Review over 9 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/42891
Updated by Markus Klein over 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 565c38c0ede18f8af6cdf2e5b86f8b364c123924.
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed