You are here

function _calendar_systems_patch_applied in Calendar Systems 7.3

Internal helper to check whether the required patch is applied or not.

Return value

Boolean value.

1 call to _calendar_systems_patch_applied()
calendar_systems_profile_overview in ./calendar_systems.admin.inc
Form callback for calendar systems profiles.

File

./calendar_systems.admin.inc, line 174
Contains Calendar Systems administration form callbacks.

Code

function _calendar_systems_patch_applied() {
  $content = file_get_contents(DRUPAL_ROOT . '/includes/common.inc');

  // Check against patch fingerprint:
  $patch_applied = strpos($content, 'foreach (module_implements(\'format_date\') AS $module) {') !== FALSE ? TRUE : FALSE;
  $new_patch_applied = strpos($content, 'foreach (module_implements(\'format_date_calendar_systems\') AS $module) {') !== FALSE ? TRUE : FALSE;
  if (!$new_patch_applied && $patch_applied) {
    return 'outdated';
  }
  if ($new_patch_applied) {
    return TRUE;
  }
  return $patch_applied;
}