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

Some fixes #40

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Some fixes #40

wants to merge 5 commits into from

Conversation

likemusic
Copy link

  1. Fix usage STDIN constant as parameter default value in \Riverline\MultiPartParser\Converters\Globals::convert().
  2. Use php://stdin or php://input depends on SAPI.
  3. Create Header block in temporary stream by getallheaders() instead of $_SERVER gloabl variable.
  4. Add getallheaders() polyfill.

1) Fix usage STDIN constant as parameter default value in \Riverline\MultiPartParser\Converters\Globals::convert().

STDIN constant defined only in CLI SAPI so when it used in other SAPI it produce notice like: Use of undefined constant STDIN - assumed 'STDIN' in ....

2) Use php://stdin or php://input depends on SAPI.

Use php://stdin if SAPI contains cli string. Not sure that it was rigth way, but it's better then before :)

3) Create Header of temporary stream by getallheaders() instead of $_SERVER gloabl variable.

Iterating over $_SERVER global variable instantinate multiple Content-Type headers, because in some configurations $_SERVER contains both HTTP_CONTENT_TYPE and CONTENT_TYPE keys. Therefore header with key content-type becomes an array. So in \Riverline\MultiPartParser\StreamedPart::parseHeaderContent() an Error will thown on $parts = explode(';', $content);.

4) Add getallheaders() polyfill.

In some configurations getallheaders() could be not defined.

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

Successfully merging this pull request may close these issues.

1 participant