From: Ilia Alshanetsky Date: Fri, 6 Aug 2010 20:04:29 +0000 (+0000) Subject: Another fix for issue indentified in bug #52550 X-Git-Tag: php-5.3.4RC1~392 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=231d8dd526845ac9f09bf05baa3e5873bdd1b3e2;p=php Another fix for issue indentified in bug #52550 --- 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)); + } } /* }}} */