From: Brion Vibber Date: Mon, 18 Oct 2004 09:49:03 +0000 (+0000) Subject: * add a require dependency X-Git-Tag: 1.5.0alpha1~1518 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=005cab63d65e8a93c96100f5e746f69143043858;p=lhc%2Fweb%2Fwiklou.git * add a require dependency * allow do_html_entity_decode() to be called with different charsets during the script lifetime --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 276a863134..303f9f01cd 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -30,6 +30,7 @@ $wgTotalEdits = -1; require_once( 'DatabaseFunctions.php' ); require_once( 'UpdateClasses.php' ); require_once( 'LogPage.php' ); +require_once( 'normal/UtfNormalUtil.php' ); /** * Compatibility functions @@ -89,8 +90,10 @@ if ( !function_exists( 'mb_substr' ) ) { */ function do_html_entity_decode( $string, $quote_style=ENT_COMPAT, $charset='ISO-8859-1' ) { static $trans; - if( !isset( $trans ) ) { + static $savedCharset; + if( !isset( $trans ) || $savedCharset != $charset ) { $trans = array_flip( get_html_translation_table( HTML_ENTITIES, $quote_style ) ); + $savedCharset = $charset; # Assumes $charset will always be the same through a run, and only understands # utf-8 or default. Note - mixing latin1 named entities and unicode numbered # ones will result in a bad link.