Skip to content

Commit

Permalink
Attempt to side-step preloading errors on PHP 7.4 (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
paragonie-security committed Dec 29, 2019
1 parent e958cae commit 0ed3206
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ function sodiumCompatAutoloader($class)
spl_autoload_register('sodiumCompatAutoloader');
}

require_once dirname(__FILE__) . '/src/SodiumException.php';
if (!class_exists('SodiumException', false)) {
require_once dirname(__FILE__) . '/src/SodiumException.php';
}
if (PHP_VERSION_ID >= 50300) {
// Namespaces didn't exist before 5.3.0, so don't even try to use this
// unless PHP >= 5.3.0
Expand Down

0 comments on commit 0ed3206

Please sign in to comment.