Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1109 breaks route setup/uri parsing #1114

Closed
puschie286 opened this issue Jul 25, 2018 · 3 comments
Closed

#1109 breaks route setup/uri parsing #1114

puschie286 opened this issue Jul 25, 2018 · 3 comments

Comments

@puschie286
Copy link
Contributor

puschie286 commented Jul 25, 2018

hey, i guess something went wrong with this PR #1109 -> it result in no route will be found
specific: IncommingRequest.php:695-698

im not sure what this change should do (@jim-parry ) but without extracting the URI part the system is unable to find any route -> PageNotFoundException

URI before 695 : /WorkDirectory/PHPPlayground/CodeIgniter4/public/Home
URI after 700 : /WorkDirectory/PHPPlayground/CodeIgniter4/public/Home
excepted : /Home

BaseURL : 192.168.100.111/WorkDirectory/PHPPlayground/CodeIgniter4/public/
$_SERVER[SCRIPT_NAME] : /WorkDirectory/PHPPlayground/CodeIgniter4/public/index.php

@jim-parry
Copy link
Contributor

Hmm - it looks like I missed or mis-specified one of the unit tests in tests/system/HTTP/IncomeRequestDetectingTest, or that we need additional test methods.
Could you take a peek and see what looks out of whack (expected resutls for a given URI)?

It looks like I specified SCRIPT_NAME as just /index,php, which is not in the BaseURL you mention above.

@puschie286
Copy link
Contributor Author

checked your tests and the testPathRequestURISubfolder fails on my machine ( windows )

so start line 689

  1. check if _S[script_name ] exist
  2. check if URI starts with _S[script_name]
    2.1 -> remove _S[script_name] -> break
  3. check if URI starts with dirname( _S[script_name] )
    4 check if URI contains _S[script_name] -> remove _S[script_name] -> break

so its just remove _S[script_name] from URI, but not if the URI doesn't contain the index file name
-> the else part is missing if 4 fails

@puschie286
Copy link
Contributor Author

puschie286 commented Aug 6, 2018

still not working - could you explain what your last part is trying to do ?
i dont get why the last check is necessary.
-> you dont handle the fail of your last elseif

i use else $uri = (string) substr($uri, strlen(dirname($_SERVER['SCRIPT_NAME']))); after your statement which fixed it for me, but im not sure what is does exactly^^

without else : $uri = "/WorkDirectory/PHPPlayground/CodeIgniter4/public/Abgelaufen"
with else : $uri = "/Abgelaufen"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants