59395[BUGFIX] Fix return type of determineSiteScript
Commit message
Review
-
Code review CR +2
- Anja Leichsenring +2
- Oliver Klee +1
- Alexander Schnitzler +1
- Susi Moog +1
-
Verified V +2
- Anja Leichsenring +2
- Alexander Schnitzler +1
- Susi Moog +1
- TYPO3com +1 CI
Issues 1
Files 2
Review log 2226
Show 1 earlier messages
-
Harald Atteneder uploaded patch set 1 01/10/19, 10:33
-
TYPO3com voted on patch set 1 V -1 01/10/19, 10:33 Completed build in 10s on Thu, 10 Jan, 11:33 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31392
-
Georg Ringer commented on patch set 2 01/10/19, 11:09
Published edit on patch set 1. -
Oliver Klee updated the commit message in patch set 3 01/10/19, 11:19
-
Oliver Klee voted on patch set 3 CR +1 01/10/19, 11:20
-
Josef Glatz voted on patch set 3 CR +1 01/10/19, 11:25
-
TYPO3com voted on patch set 2 V +1 01/10/19, 11:25 Completed build in 15m 26s on Thu, 10 Jan, 12:25 PM Test Summary: 47625 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31394
-
TYPO3com voted on patch set 3 V +1 01/10/19, 11:33 Completed build in 12m 06s on Thu, 10 Jan, 12:33 PM Test Summary: 47625 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31396
-
Alexander Schnitzler voted on patch set 3 V +1 CR +1 01/10/19, 12:39
-
Christian Kuhn commented on patch set 3 01/10/19, 13:17
Is it possible to trigger the issue with a unit test? NormalizedParams has high test coverage, so it seems there is just one test missing? Basically, a unit test should show that it fails without the string cast and is green if it is added. -
Christian Kuhn commented on patch set 3 CR -1 01/10/19, 13:24
maybe i can come up with something. -
Christian Kuhn commented on patch set 3 01/10/19, 13:42
i don't get it. first, if i execute locally: var_dump(substr('123456', 6)); then it DOES return an empty string as result. i also added a test set (without the string cast) to NormalizedParams method getSiteScriptReturnsExpectedPathDataProvider() and it is green without the patch: 'no path' => [ [ 'SCRIPT_NAME' => '', 'HTTP_HOST' => 'www.domain.com', ], '/var/www/myInstance/Web/', '/var/www/myInstance/Web', '' ], What am i doing wrong to trigger the issue? -
Alexander Schnitzler commented on patch set 3 01/10/19, 13:58
To be clear on this one: I did not test this with actual input variables. The mere fact, that substr can return false made me check that var_dump((string)false); returns an empty string and is therefore compatible with the return type and never throws a TypeError here. I personally don't need a test here because I don't know what exactly triggers substr to return a bool but as it is possible in general and conflicts with the return type contract I'd merge that. -
Christian Kuhn commented on patch set 3 01/10/19, 15:42
Still, I think it would be useful to know how exactly such a scenario can be produced. For me, $requestUrl is always at least as long as or longer than $siteUrl. -
Harald Atteneder commented on patch set 3 01/10/19, 19:19
> Still, I think it would be useful to know how exactly such a > scenario can be produced. For me, $requestUrl is always at least as > long as or longer than $siteUrl. Steps to reproduce: 1. Web server uses /html/ as web root. Due to hosting limitations this can not be changed 2. Install TYPO3 via composer inside /html/ 3. Create /html/.htaccess to rewrite all URLs to /html/public/ since this is where composer install the index.php of TYPO3 Contents of .htaccess: ``` RewriteEngine on RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(.*)$ /public/$1 [L] ``` 4. When visiting the frontend, you get the error message mentioned here: https://forge.typo3.org/issues/87387 $requestUrl: "http://domain.tld/" $siteUrl: "http://domain.tld/public/" -
Alexander Schnitzler uploaded patch set 4 01/15/19, 14:10
-
Alexander Schnitzler commented on patch set 4 01/15/19, 14:11
@Harald: Can you please check that the data I used in the unit test matches your setup and use case? -
TYPO3com voted on patch set 4 V +1 01/15/19, 14:25 Completed build in 14m 53s on Tue, 15 Jan, 03:25 PM Test Summary: 47550 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-31523
-
Harald Atteneder commented on patch set 4 01/18/19, 12:20
> @Harald: > Can you please check that the data I used in the unit test matches > your setup and use case? Here are some of my server vars: REQUEST_URI="/" SCRIPT_NAME="/public/index.php" HTTP_HOST="www.domain.com" SCRIPT_FILENAME="/var/www/html/public/index.php" SCRIPT_NAME="/public/index.php" DOCUMENT_ROOT="/var/www/html/" CWD="/public/" Here is my .htaccess RewriteEngine on RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(.*)$ /public/$1 [L] I hope that helps… -
Susi Moog commented on patch set 4 V +1 CR +1 01/22/19, 18:02
Patch verified via the Unit Test and manual testing with instructions provided. -
Alexander Schnitzler voted on patch set 4 V +1 CR +1 01/22/19, 22:24
-
Oliver Klee voted on patch set 4 CR +1 01/22/19, 23:03
-
Josef Glatz wrote 01/24/19, 06:14
Removed reviewer Josef Glatz. -
Anja Leichsenring voted on patch set 4 V +2 CR +2 02/01/19, 16:43
-
Anja Leichsenring merged patch set 5 02/01/19, 16:43
-
Anja Leichsenring commented on patch set 5 02/01/19, 16:43
Cherry Picked This patchset was cherry picked to branch 9.5 as commit e7c3efdd5b63e069c9b09b96a50fc277377fcdca