From 88d4c55ec38c68c07496ed059616b15622fc83e7 Mon Sep 17 00:00:00 2001 From: uckelman Date: Sun, 31 Oct 2010 20:53:21 +0000 Subject: 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 --- src/Util.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Util.php') 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); } ?> -- cgit v1.2.3