From: Tim Starling Date: Mon, 14 Jun 2004 08:58:10 +0000 (+0000) Subject: fixed bug for PHP <4.3.0 X-Git-Tag: 1.5.0alpha1~2853 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=5cc5b123cd49440dc5a3c6ab1af356494febecf5;p=lhc%2Fweb%2Fwiklou.git fixed bug for PHP <4.3.0 --- 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