PHP does not automatically parse x-www-form-urlencoded params originating from PUT requests. Therefore, I suggest that symfony should parse x-www-form-urlencoded params originating from PUT-requests and add them to sfRequest's parameterHolder and to sfWebRequest's postParameters.
-
a/lib/vendors/symfony/lib/request/sfWebRequest.class.php
| old |
new |
|
| 64 | 64 | $this->parameterHolder->add($this->getParameters); |
|---|
| 65 | 65 | |
|---|
| 66 | 66 | // POST parameters |
|---|
| 67 | | $this->postParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_POST) : $_POST; |
|---|
| 68 | | $this->parameterHolder->add($this->postParameters); |
|---|
| 69 | | |
|---|
| | 67 | $postParameters = $_POST; |
|---|
| | 68 | |
|---|
| 70 | 69 | if (isset($_SERVER['REQUEST_METHOD'])) |
|---|
| 71 | 70 | { |
|---|
| 72 | 71 | switch ($_SERVER['REQUEST_METHOD']) |
| … | … | |
| 81 | 80 | break; |
|---|
| 82 | 81 | |
|---|
| 83 | 82 | case 'PUT': |
|---|
| | 83 | if ($_SERVER['CONTENT_TYPE'] === 'application/x-www-form-urlencoded') |
|---|
| | 84 | { |
|---|
| | 85 | parse_str(file_get_contents("php://input"), $postParameters); |
|---|
| | 86 | } |
|---|
| 84 | 87 | $this->setMethod(self::PUT); |
|---|
| 85 | 88 | break; |
|---|
| 86 | 89 | |
| … | … | |
| 101 | 104 | // set the default method |
|---|
| 102 | 105 | $this->setMethod(self::GET); |
|---|
| 103 | 106 | } |
|---|
| | 107 | |
|---|
| | 108 | $this->postParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($postParameters) : $postParameters; |
|---|
| | 109 | $this->parameterHolder->add($this->postParameters); |
|---|
| 104 | 110 | |
|---|
| 105 | 111 | if (isset($this->options['formats'])) |
|---|
| 106 | 112 | { |