MantisBT: master 4b638dde

Author Committer Branch Timestamp Parent
atrol atrol master 2023-06-10 10:51 master 291e843f
Affected Issues  0032714: Remove function check_php_version()
Changeset

Remove function check_php_version

function check_php_version is questionable in some terms

  • check for $p_version == PHP_MIN_VERSION will hardly ever evaluate to
    true in real life (who is running exactly PHP 7.0.0?)
  • parameter $p_version is not used in else case,
    this was hardly what was wanted, but did not introduce any bug,
    as phpversion() is used instead of the parameter
  • check function_exists( 'version_compare' ) is not necessary as
    • according documentation, version_compare() is available starting
      from PHP 4.1 [1]
    • we use version_compare() at various other places in code without
      checking if it exists

Thus

  • remove the function
  • replace the single place where it's called by using version_compare()

Fixes 0032714

[1] https://www.php.net/manual/de/function.version-compare.php

mod - admin/install.php Diff File
mod - core/install_helper_functions_api.php Diff File