Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-10378

Use version_compare() for extension version comparison

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.1.3, 4.2.0
    • Fix Version/s: 4.2.0
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      CiviCRM's extensions page rolls its own version comparison via explode/foreach.

      version_compare() is a better way to do this, because it correctly identifies the following version comparisons which IMO the existing implementation gets wrong -

      2.1 >= 1.1
      1.0.1 >= 1.0
      1.1-beta1 <= 1.1

      It's not clear why CRM_Core_Extensions::getExtensions() has its own logic - version_compare() is used in ~150 places throughout CiviCRM.

        Attachments

          Activity

            People

            • Assignee:
              xurizaemon Chris Burgess
              Reporter:
              xurizaemon Chris Burgess
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: