diff options
author | mrjive <mrjive@mrjive.it> | 2016-01-14 09:30:50 +0100 |
---|---|---|
committer | mrjive <mrjive@mrjive.it> | 2016-01-14 09:30:50 +0100 |
commit | 5c937c5642e87750b55e15c9d9c1b863e5d5cfc1 (patch) | |
tree | 5ef2c09452b4d511f895d0fa3164fb614307f8c4 /include/plugin.php | |
parent | 3206a46a9297dcbdc56c25512767dfb5bf66837b (diff) | |
parent | e500a08f152d641f60c7146c6a290042bdd37a73 (diff) | |
download | volse-hubzilla-5c937c5642e87750b55e15c9d9c1b863e5d5cfc1.tar.gz volse-hubzilla-5c937c5642e87750b55e15c9d9c1b863e5d5cfc1.tar.bz2 volse-hubzilla-5c937c5642e87750b55e15c9d9c1b863e5d5cfc1.zip |
Merge pull request #15 from redmatrix/master
updating from original codebase
Diffstat (limited to 'include/plugin.php')
-rwxr-xr-x | include/plugin.php | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/include/plugin.php b/include/plugin.php index 4da73dfd8..2bc363556 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -348,19 +348,46 @@ function get_plugin_info($plugin){ } else { $info[$k][] = array('name' => $v); } - } else { -// if (array_key_exists($k, $info)){ - $info[$k] = $v; -// } + } + else { + $info[$k] = $v; } } } } - return $info; } +function check_plugin_versions($info) { + + if(! is_array($info)) + return true; + + if(array_key_exists('minversion',$info)) { + if(version_compare(trim($info['minversion']),STD_VERSION, '>=')) { + logger('minversion limit: ' . $info['name'],LOGGER_NORMAL,LOG_WARNING); + return false; + } + } + if(array_key_exists('maxversion',$info)) { + if(version_compare(STD_VERSION,trim($info['maxversion']), '>')) { + logger('maxversion limit: ' . $info['name'],LOGGER_NORMAL,LOG_WARNING); + return false; + } + } + if(array_key_exists('minphpversion',$info)) { + if(version_compare(trim($info['minphpversion']),PHP_VERSION, '>=')) { + logger('minphpversion limit: ' . $info['name'],LOGGER_NORMAL,LOG_WARNING); + return false; + } + } + + return true; +} + + + /** * @brief Parse theme comment in search of theme infos. |