Commit 1c91cd2e authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-1096 Check for mapi externsion first and fail early.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 94bc7a79
...@@ -219,19 +219,17 @@ class Utils { ...@@ -219,19 +219,17 @@ class Utils {
* @return boolean installed version is superior to the checked string * @return boolean installed version is superior to the checked string
*/ */
static public function CheckMapiExtVersion($version = "") { static public function CheckMapiExtVersion($version = "") {
if (!extension_loaded("mapi")) {
return false;
}
// compare build number if requested // compare build number if requested
if (preg_match('/^\d+$/', $version) && strlen($version) > 3) { if (preg_match('/^\d+$/', $version) && strlen($version) > 3) {
$vs = preg_split('/-/', phpversion("mapi")); $vs = preg_split('/-/', phpversion("mapi"));
return ($version <= $vs[1]); return ($version <= $vs[1]);
} }
if (extension_loaded("mapi")){
if (version_compare(phpversion("mapi"), $version) == -1){ if (version_compare(phpversion("mapi"), $version) == -1){
return false; return false;
} }
}
else
return false;
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment