Skip to content

Commit

Permalink
Merge pull request #102 from nicolas-grekas/libsodium
Browse files Browse the repository at this point in the history
Fix compat with libsodium
  • Loading branch information
paragonie-scott authored Oct 18, 2019
2 parents 462fce4 + 45d0035 commit b7115d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function sodiumCompatAutoloader($class)
require_once dirname(__FILE__) . '/lib/sodium_compat.php';
}
if (PHP_VERSION_ID < 70200 || !extension_loaded('sodium')) {
if (PHP_VERSION_ID >= 50300 && !defined('SODIUM_LIBRARY_VERSION_MAJOR')) {
if (PHP_VERSION_ID >= 50300 && !defined('SODIUM_LIBRARY_MAJOR_VERSION')) {
require_once dirname(__FILE__) . '/lib/php72compat_const.php';
}
assert(class_exists('ParagonIE_Sodium_Compat'), 'Possible filesystem/autoloader bug?');
Expand Down
6 changes: 3 additions & 3 deletions lib/php72compat_const.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

const SODIUM_LIBRARY_VERSION_MAJOR = 9;
const SODIUM_LIBRARY_VERSION_MINOR = 1;
const SODIUM_VERSION_STRING = 'polyfill-1.0.8';
const SODIUM_LIBRARY_MAJOR_VERSION = 9;
const SODIUM_LIBRARY_MINOR_VERSION = 1;
const SODIUM_LIBRARY_VERSION = '1.0.8';

const SODIUM_BASE64_VARIANT_ORIGINAL = 1;
const SODIUM_BASE64_VARIANT_ORIGINAL_NO_PADDING = 3;
Expand Down

0 comments on commit b7115d0

Please sign in to comment.