From 081f2cb82534495ba6a6c93cf47806bba4cf911e Mon Sep 17 00:00:00 2001 From: terrafrost Date: Sat, 18 Jul 2015 00:50:59 -0500 Subject: [PATCH] Random: replace user_error with exception --- phpseclib/Crypt/Random.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpseclib/Crypt/Random.php b/phpseclib/Crypt/Random.php index cc134d63..1bcffe4d 100644 --- a/phpseclib/Crypt/Random.php +++ b/phpseclib/Crypt/Random.php @@ -49,6 +49,7 @@ class Random * eg. for RSA key generation. * * @param Integer $length + * @throws \RuntimeException if a symmetric cipher is needed but not loaded * @return String */ public static function string($length) @@ -199,8 +200,7 @@ class Random $crypto = new RC4(); break; default: - user_error(__CLASS__ . ' requires at least one symmetric cipher be loaded'); - return false; + throw new \RuntimeException(__CLASS__ . ' requires at least one symmetric cipher be loaded'); } $crypto->setKey($key);