{
long type;
getObject(http_message_object, obj);
-
+
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &type)) {
return;
}
/* {{{ bool HttpMessage::setResponseCode(long code)
*
* Set the response code of an HTTP Response Message.
- * Returns false if the Message is not of type HTTP_MSG_RESPONSE,
+ * Returns false if the Message is not of type HTTP_MSG_RESPONSE,
* or if the response code is out of range (100-510).
*/
PHP_METHOD(HttpMessage, setResponseCode)
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &code)) {
RETURN_FALSE;
}
- if (code < 100 && code > 510) {
+ if (code < 100 || code > 510) {
http_error_ex(E_WARNING, HTTP_E_PARAM, "Invalid response code (100-510): %ld", code);
RETURN_FALSE;
}
/* }}} */
/* {{{ bool HttpMessage::setHttpVersion(string version)
- *
+ *
* Set the HTTP Protocol version of the Message.
* Returns false if version is invalid (1.0 and 1.1).
*/
zval *v;
zval *version;
getObject(http_message_object, obj);
-
+
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &v)) {
return;
}