summaryrefslogtreecommitdiff
path: root/src/Util.php
blob: f06718d7cd4ddb50e5d855121f27d5df5346d289 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

function throw_if_null($arg) {
  if ($arg === null) throw new Exception('argument is null');
}

function build_message_id($time, $postId, $forumHost) {
  return "<$time.$postId.bridge@$forumHost>";
}

/*
function is_ascii($string) {
  return !preg_match('/[^\x00-\x7F]/S', $str);
}
*/

function utf8_quote($string) {
  return '=?UTF-8?B?' . base64_encode($string) . '?=';
}

?>