summaryrefslogtreecommitdiff
path: root/src/Util.php
blob: 38aec11be6e8f7156dcec9fef345a9ebcb6d8c3a (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($postId, $editId, $time, $forumHost) {
  return "<$time.$postId.$editId.bridge@$forumHost>";
}

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

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

?>