|
|
@@ -386,13 +386,17 @@ class Zend_Http_Client
|
|
|
public function setMethod($method = self::GET)
|
|
|
{
|
|
|
if (! preg_match('/^[^\x00-\x1f\x7f-\xff\(\)<>@,;:\\\\"\/\[\]\?={}\s]+$/', $method)) {
|
|
|
- /** @see Zend_Http_Client_Exception */
|
|
|
require_once 'Zend/Http/Client/Exception.php';
|
|
|
throw new Zend_Http_Client_Exception("'{$method}' is not a valid HTTP request method.");
|
|
|
}
|
|
|
|
|
|
- if (($method == self::POST || $method == self::PUT || $method == self::DELETE || $method == self::PATCH
|
|
|
- || $method == self::OPTIONS) && $this->enctype === null) {
|
|
|
+ if (($method == self::POST
|
|
|
+ || $method == self::PUT
|
|
|
+ || $method == self::DELETE
|
|
|
+ || $method == self::PATCH
|
|
|
+ || $method == self::OPTIONS)
|
|
|
+ && $this->enctype === null
|
|
|
+ ) {
|
|
|
$this->setEncType(self::ENC_URLENCODED);
|
|
|
}
|
|
|
|