From 5cc5b123cd49440dc5a3c6ab1af356494febecf5 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 14 Jun 2004 08:58:10 +0000 Subject: [PATCH] fixed bug for PHP <4.3.0 --- includes/GlobalFunctions.php | 60 +++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 29 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 27f126933a..7e4d9117a0 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -150,16 +150,16 @@ function wfUrlencode ( $s ) } function wfUtf8Sequence($codepoint) { - if($codepoint < 0x80) return chr($codepoint); - if($codepoint < 0x800) return chr($codepoint >> 6 & 0x3f | 0xc0) . - chr($codepoint & 0x3f | 0x80); - if($codepoint < 0x10000) return chr($codepoint >> 12 & 0x0f | 0xe0) . - chr($codepoint >> 6 & 0x3f | 0x80) . - chr($codepoint & 0x3f | 0x80); + if($codepoint < 0x80) return chr($codepoint); + if($codepoint < 0x800) return chr($codepoint >> 6 & 0x3f | 0xc0) . + chr($codepoint & 0x3f | 0x80); + if($codepoint < 0x10000) return chr($codepoint >> 12 & 0x0f | 0xe0) . + chr($codepoint >> 6 & 0x3f | 0x80) . + chr($codepoint & 0x3f | 0x80); if($codepoint < 0x100000) return chr($codepoint >> 18 & 0x07 | 0xf0) . # Double-check this - chr($codepoint >> 12 & 0x3f | 0x80) . - chr($codepoint >> 6 & 0x3f | 0x80) . - chr($codepoint & 0x3f | 0x80); + chr($codepoint >> 12 & 0x3f | 0x80) . + chr($codepoint >> 6 & 0x3f | 0x80) . + chr($codepoint & 0x3f | 0x80); # Doesn't yet handle outside the BMP return "&#$codepoint;"; } @@ -370,16 +370,18 @@ function wfAbruptExit(){ } function wfDebugDieBacktrace( $msg = '' ) { - $msg .= "\n

Backtrace:

\n