From 34e8b615ed38f938d70533dde3a59e601c2360ce Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 6 Aug 2010 20:04:29 +0000 Subject: [PATCH] Another fix for issue indentified in bug #52550 --- ext/standard/math.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/standard/math.c b/ext/standard/math.c index 0691dc0402..31848a3681 100644 --- a/ext/standard/math.c +++ b/ext/standard/math.c @@ -690,7 +690,11 @@ PHP_FUNCTION(log) php_error_docref(NULL TSRMLS_CC, E_WARNING, "base must be greater than 0"); RETURN_FALSE; } - RETURN_DOUBLE(log(num) / log(base)); + if (base == 1) { + RETURN_DOUBLE(NAN); + } else { + RETURN_DOUBLE(log(num) / log(base)); + } } /* }}} */ -- 2.50.1