diff options
author | uckelman <uckelman@nomic.net> | 2010-10-31 20:53:21 +0000 |
---|---|---|
committer | uckelman <uckelman@nomic.net> | 2010-10-31 20:53:21 +0000 |
commit | 88d4c55ec38c68c07496ed059616b15622fc83e7 (patch) | |
tree | d54d2449e66d359cac3d4bc6171e072c4832b1f8 /src/Util.php | |
parent | 54551bc4cb0dee8549c229d18fca3bf3dc0d5c48 (diff) |
Major refactoring to make bridge easier to test.
git-svn-id: https://vassalengine.svn.sourceforge.net/svnroot/vassalengine/site-src/trunk@7431 67b53d14-2c14-4ace-a08f-0dab2b34000c
Diffstat (limited to 'src/Util.php')
-rw-r--r-- | src/Util.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Util.php b/src/Util.php index 2535bc5..0f1499a 100644 --- a/src/Util.php +++ b/src/Util.php @@ -24,16 +24,16 @@ 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($str) { + return !preg_match('/[^[:ascii:]]/', $str); } -function is_ascii($string) { - return !preg_match('/[^[:ascii:]]/', $str); +function utf8_quote($str) { + return '=?UTF-8?B?' . base64_encode($str) . '?='; } -function utf8_quote($string) { - return '=?UTF-8?B?' . base64_encode($string) . '?='; +function utf8_quote_non_ascii($str) { + return is_ascii($str) ? $str : utf8_quote($str); } ?> |