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

Already on GitHub? Sign in to your account

The fromString function fail as the http headers returned by $_SERVER variable are of the form HTTP_USER_AGENT #887

Merged
merged 1 commit into from Mar 5, 2012

Conversation

Projects
None yet
2 participants
Contributor

rsandrea commented Mar 5, 2012

I do not know if this is the right way to do it, but line 19 won't validate as the headers are cleaned up for the HTTP_ prefix but the _ signs are never replaced by -, hence the validation fail.

I took the str_replace(array('_', ' ', '.'), '-', strtolower($name)) idea from the file Zend/Http/Headers.php on line 284 as this is the way the $key variable is created.

If anyone finds a better way to do it please message me.

@rsandrea rsandrea The fromString function fail as the http headers returned by $_SERVER…
… variables are of the form HTTP_USER_AGENT.


I do not know if this is the right way to do it, but line 19 won't validate as the headers are cleaned up for the HTTP_ prefix but the _ signs are never replaced by -, hence the validation fail.

I took the str_replace(array('_', ' ', '.'), '-', strtolower($name)) idea from the file Zend/Http/Headers.php on line 284 as this is the way the $key variable is created.

If anyone finds a better way to do it please message me.
a10dcfc

@weierophinney weierophinney merged commit a10dcfc into zendframework:master Mar 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment