You are here

public static function Conversion::swiftmailer_is_date_header in Swift Mailer 8

Same name and namespace in other branches
  1. 8.2 src/Utility/Conversion.php \Drupal\swiftmailer\Utility\Conversion::swiftmailer_is_date_header()

Checks whether a header is a date header.

Parameters

string $key: The header key.

string $value: The header value.

Return value

bool TRUE if the provided header is a date header, and otherwise FALSE.

See also

http://swift_mailer.org/docs/header-date

1 call to Conversion::swiftmailer_is_date_header()
Conversion::swiftmailer_get_headertype in src/Utility/Conversion.php
Determines the header type based on the a header key and value.

File

src/Utility/Conversion.php, line 169

Class

Conversion
@todo

Namespace

Drupal\swiftmailer\Utility

Code

public static function swiftmailer_is_date_header($key, $value) {
  if (preg_match('/' . static::SWIFTMAILER_DATE_PATTERN . '/', $value)) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}