From a794937ce1c9108de44c49c653713dae80f796b6 Mon Sep 17 00:00:00 2001 From: Jonathan Azoff Date: Mon, 4 May 2015 20:11:16 -0700 Subject: [PATCH] Fix PHP version comparison So that it doesn't break clients without a "-" in the version number. --- .../ForceDotComToolkitForPhp/SforceBaseClient.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Davispeixoto/ForceDotComToolkitForPhp/SforceBaseClient.php b/src/Davispeixoto/ForceDotComToolkitForPhp/SforceBaseClient.php index 6091511..32806c2 100644 --- a/src/Davispeixoto/ForceDotComToolkitForPhp/SforceBaseClient.php +++ b/src/Davispeixoto/ForceDotComToolkitForPhp/SforceBaseClient.php @@ -113,10 +113,8 @@ public function printDebugInfo() */ public function createConnection($wsdl, $proxy = null, $soap_options = array()) { - // We don't need to parse out any subversion suffix - e.g. "-01" since - // PHP type conversion will ignore it - $phpversion = substr(phpversion(), 0, strpos(phpversion(), '-')); - if ($phpversion < 5.3) { + // use correct version comparison + if (version_compare(phpversion(), '5.3', '<')) { throw new Exception ('PHP versions older than 5.3 are no longer supported. Please upgrade!'); }