diff --git a/aes.module b/aes.module index 49bdd1e..179ebb1 100755 --- a/aes.module +++ b/aes.module @@ -50,7 +50,12 @@ function aes_permission() { function aes_load_phpsec() { //find out where this module is located and set up an include path for the phpsec library - $phpsec_include_path = dirname(__FILE__)."/phpseclib"; + if (module_exists('libraries')) { + $phpsec_include_path = libraries_get_path('phpseclib'); + } + else { + $phpsec_include_path = dirname(__FILE__)."/phpseclib"; + } //include phpsec AES lib if (file_exists($phpsec_include_path.'/Crypt/AES.php') === false) {