Returns true if a message has the provided case-insensitive header.

@param array  $message Request or response hash.
@param string $header  Header to check

@return bool
776302
public static function hasHeader($message, $header)
    {
        if (!empty($message['headers'])) {
            foreach ($message['headers'] as $name => $value) {
                if (!strcasecmp($name, $header)) {
                    return true;
                }
            }
        }

        return false;
    }
929228
public function hasHeader(string $headerName): bool
	{

		if (array_key_exists($headerName, $this->getHeaders())) {
			return true;
		}
		return false;
	}
48906
public function header($header = null) {
			if ($this->_status != null) {
				array_push($this->_headers, $header);
				return true;
			}
			else {
				return $this->_headers;
			}
		}
183278
public function isSignedMessageValid($address, $signature, $message)
    {
        $args = [
            (string)$address,
            (string)$signature,
            (string)$message
        ];
        return $this->rpc->query("verifyMessage", $args);
    }
241663
protected function isValidMessage($message): Message
    {
        if ($message instanceof Message) {
            return $message;
        }

        if (\is_string($message) || $message instanceof Attachment) {
            return Message::create($message);
        }

        throw new MessengerException(sprintf(
            'message must be a string or an instance of %s or %s.',
            Message::class,
            Attachment::class
        ));
    }
164031
function sign($message)
    {
        if (empty($this->modulus) || empty($this->exponent)) {
            return false;
        }

        switch ($this->signatureMode) {
            case self::SIGNATURE_PKCS1:
                return $this->_rsassa_pkcs1_v1_5_sign($message);
            //case self::SIGNATURE_PSS:
            default:
                return $this->_rsassa_pss_sign($message);
        }
    }
77834
public function hasTranslation($message) {
		if($this->language === null) {
			$this->initLanguage();
		}
		
		//Load the main file
		if($this->msg === null) {
			$this->retrieveMessages($this->language);
		}
		
		//If the translation is not in the main file, load the custom file associated to the message
		if(!isset($this->msg[$message])) {
			$this->retrieveCustomMessages($message, $this->language);
		}
		
		if (isset($this->msg[$message])) {
			return true;
		} else {
			return false;
		}
	}
298673
public function isValid(Message $message)
    {
        try {
            $this->validate($message);
            return true;
        } catch (InvalidSnsMessageException $e) {
            return false;
        }
    }
75101
public function hasMessage(GmailMessageInterface $message): bool
    {
        if ($this->messages->contains($message)) {
            return true;
        }

        return false;
    }
614748
private function hasHeader($headers, $name)
    {
        foreach ($headers as $header) {
            if (strncasecmp($header, "{$name}: ", strlen($name) + 2) === 0) {
                return true;
            }
        }

        return false;
    }
411761
def has_bad_headers(self):
        
        headers = [self.sender, self.reply_to] + self.recipients
        for header in headers:
            if _has_newline(header):
                return True

        if self.subject:
            if _has_newline(self.subject):
                for linenum, line in enumerate(self.subject.split('\r\n')):
                    if not line:
                        return True
                    if linenum > 0 and line[0] not in '\t ':
                        return True
                    if _has_newline(line):
                        return True
                    if len(line.strip()) == 0:
                        return True
        return False
875459
public function onJobMessage(array $message) : bool
    {
        $jobName = $message[0];
        $jobId = $message[1];
        $workerId = $message[2];
        $payload = $message[3];

        // Skip if job is assigned to another worker:
        if ($workerId !== $this->workerId) {
            return false;
        }

        // Skip if worker can not handle the requested job
        if (!isset($this->callbacks[$jobName])) {
            throw new WorkerException('No callback found for requested job.');
        }

        // Switch to busy state handle job and switch back to idle state:
        $this->jobId = $jobId;
        $this->setState(Worker::WORKER_STATE_BUSY);
        $result = call_user_func($this->callbacks[$jobName], $payload);
        $this->onJobCompleted($result);
        $this->setState(Worker::WORKER_STATE_IDLE);
        return true;
    }
227112
public function sendRequest(array $message): bool
    {
        try {
            $recipient = preg_replace('/\s+/', '', $message['to']) . "@" . $this->endpoint;
            $this->mailer->send($recipient, $message['content']);
            return true;
        } catch (\Exception $e) {
            return false;
        }
    }
1208843
function mail_send($header, $body) {
      //$to = substr($this->addr_append("To", $this->to), 4, -2);

      // Cannot add Bcc's to the $to
      $to = $this->to[0][0]; // no extra comma
      for($i = 1; $i < count($this->to); $i++)
         $to .= sprintf(",%s", $this->to[$i][0]);

      if ($this->Sender != "" && PHP_VERSION >= "4.0")
      {
         $old_from = ini_get("sendmail_from");
         ini_set("sendmail_from", $this->Sender);
      }

      if ($this->Sender != "" && PHP_VERSION >= "4.0.5")
      {
         // The fifth parameter to mail is only available in PHP >= 4.0.5
         $params = sprintf("-f %s", $this->Sender);
         $rt = @mail($to, $this->Subject, $body, $header, $params);
      }
      else
      {
         $rt = @mail($to, $this->Subject, $body, $header);
      }

      if (isset($old_from))
         ini_set("sendmail_from", $old_from);

      if(!$rt)
      {
         $this->error_handler("Could not instantiate mail()");
         return false;
      }

      return true;
   }
822664
public function delete($header = null) {

        if (is_null($header)) {

            $this->headers = [];

            return true;

        }

        $index = $this->getIndexCaseInsensitive($header);

        if ( $index === null ) {
            return false;
        }

        unset($this->headers[$index]);
        return true;

    }
255948
protected function unique($key, $message)
        {
            return !isset($this->messages[$key]) || !Arrays::in($message, $this->messages[$key]);
        }
993609
public function matches(MessageReceived $message): bool
    {
        if ($this->type === null) {
            return $message->getAttachment() !== null;
        }

        return hash_equals($message->getAttachment()->getType(), $this->type);
    }