diff --git a/ext/http/request.c b/ext/http/request.c index 7cb4caa4608..2632b549526 100644 --- a/ext/http/request.c +++ b/ext/http/request.c @@ -2035,6 +2035,10 @@ PHP_METHOD(Phalcon_Http_Request, getBasicAuth){ RETURN_NULL(); } + if (!auth_password) { + auth_password = ""; + } + array_init_size(return_value, 2); add_assoc_stringl_ex(return_value, SS("username"), auth_user, strlen(auth_user), 1); add_assoc_stringl_ex(return_value, SS("password"), auth_password, strlen(auth_password), 1);