From 677ae387b0a24530bc7c5d43d94dc333bdfaf099 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sun, 26 May 2019 15:38:18 -0500 Subject: [PATCH] BigInteger: backport GMP fixes from master branch --- phpseclib/Math/BigInteger.php | 2 +- tests/Unit/Math/BigInteger/TestCase.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/phpseclib/Math/BigInteger.php b/phpseclib/Math/BigInteger.php index 1807e4aa..9d41a5c2 100644 --- a/phpseclib/Math/BigInteger.php +++ b/phpseclib/Math/BigInteger.php @@ -441,7 +441,7 @@ class Math_BigInteger // (?<=^|-)0*: find any 0's that are preceded by the start of the string or by a - (ie. octals) // [^-0-9].*: find any non-numeric characters and then any characters that follow that $x = preg_replace('#(?getInstance('00'); $this->assertSame($temp->toString(), '0'); + + $temp = $this->getInstance('-0'); + $this->assertSame($temp->toString(), '0'); } }