protected function checkValidHeader($key, $value, &$error) {
    if (!is_string($key)) {
      $error = sprintf("Header key is not a string (Actual type: %s).",
                       gettype($key));
      return false;
    } else if (!in_array(strtolower($key), self::$allowed_headers)) {
      // Array keys don't have consistent case.
      $error = sprintf("Input header '%s: %s' is not whitelisted for use with" .
                       " the Google App Engine Mail Service.",
                       htmlspecialchars($key),
                       htmlspecialchars($value));
      return false;
    }
    return true;
  }
protected function checkValidHeader($key, $value, &$error) {
    if (!is_string($key)) {
      $error = sprintf("Header key is not a string (Actual type: %s).",
                       gettype($key));
      return false;
    } else if (!in_array(strtolower($key), self::$allowed_headers)) {
      // Array keys don't have consistent case.
      $error = sprintf("Input header '%s: %s' is not whitelisted for use with" .
                       " the Google App Engine Mail Service.",
                       htmlspecialchars($key),
                       htmlspecialchars($value));
      return false;
    }
    return true;
  }
protected function checkValidHeader ( $ key , $ value , & $ error ) { if ( ! is_string ( $ key ) ) { $ error = sprintf ( "Header key is not a string (Actual type: %s)." , gettype ( $ key ) ) ; return false ; } else if ( ! in_array ( strtolower ( $ key ) , self :: $ allowed_headers ) ) { // Array keys don't have consistent case. $ error = sprintf ( "Input header '%s: %s' is not whitelisted for use with" . " the Google App Engine Mail Service." , htmlspecialchars ( $ key ) , htmlspecialchars ( $ value ) ) ; return false ; } return true ; }
Check validity of a header pair.

@param string $key Header key.
@param string $value Header value.
@param string &$error Error message to be set if the header is invalid.
@return bool True if successful, false otherwise.
Check validity of a header pair .