From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/normal/UtfNormal.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'includes/normal/UtfNormal.php') diff --git a/includes/normal/UtfNormal.php b/includes/normal/UtfNormal.php index 08f85bd3..77ddb79b 100644 --- a/includes/normal/UtfNormal.php +++ b/includes/normal/UtfNormal.php @@ -37,7 +37,7 @@ define( 'NORMALIZE_INTL', function_exists( 'normalizer_normalize' ) ); * * Not as fast as I'd like, but should be usable for most purposes. * UtfNormal::toNFC() will bail early if given ASCII text or text - * it can quickly deterimine is already normalized. + * it can quickly determine is already normalized. * * All functions can be called static. * @@ -73,7 +73,7 @@ class UtfNormal { * Fast return for pure ASCII strings; some lesser optimizations for * strings containing only known-good characters. Not as fast as toNFC(). * - * @param $string String: a UTF-8 string + * @param string $string a UTF-8 string * @return string a clean, shiny, normalized UTF-8 string */ static function cleanUp( $string ) { @@ -114,7 +114,7 @@ class UtfNormal { * Fast return for pure ASCII strings; some lesser optimizations for * strings containing only known-good characters. * - * @param $string String: a valid UTF-8 string. Input is not validated. + * @param string $string a valid UTF-8 string. Input is not validated. * @return string a UTF-8 string in normal form C */ static function toNFC( $string ) { @@ -132,7 +132,7 @@ class UtfNormal { * Convert a UTF-8 string to normal form D, canonical decomposition. * Fast return for pure ASCII strings. * - * @param $string String: a valid UTF-8 string. Input is not validated. + * @param string $string a valid UTF-8 string. Input is not validated. * @return string a UTF-8 string in normal form D */ static function toNFD( $string ) { @@ -151,7 +151,7 @@ class UtfNormal { * This may cause irreversible information loss, use judiciously. * Fast return for pure ASCII strings. * - * @param $string String: a valid UTF-8 string. Input is not validated. + * @param string $string a valid UTF-8 string. Input is not validated. * @return string a UTF-8 string in normal form KC */ static function toNFKC( $string ) { @@ -170,7 +170,7 @@ class UtfNormal { * This may cause irreversible information loss, use judiciously. * Fast return for pure ASCII strings. * - * @param $string String: a valid UTF-8 string. Input is not validated. + * @param string $string a valid UTF-8 string. Input is not validated. * @return string a UTF-8 string in normal form KD */ static function toNFKD( $string ) { @@ -197,7 +197,7 @@ class UtfNormal { /** * Returns true if the string is _definitely_ in NFC. * Returns false if not or uncertain. - * @param $string String: a valid UTF-8 string. Input is not validated. + * @param string $string a valid UTF-8 string. Input is not validated. * @return bool */ static function quickIsNFC( $string ) { @@ -237,7 +237,7 @@ class UtfNormal { /** * Returns true if the string is _definitely_ in NFC. * Returns false if not or uncertain. - * @param $string String: a UTF-8 string, altered on output to be valid UTF-8 safe for XML. + * @param string $string a UTF-8 string, altered on output to be valid UTF-8 safe for XML. * @return bool */ static function quickIsNFCVerify( &$string ) { @@ -503,8 +503,8 @@ class UtfNormal { * (depending on which decomposition map is passed to us). * Input is assumed to be *valid* UTF-8. Invalid code will break. * @private - * @param $string String: valid UTF-8 string - * @param $map Array: hash of expanded decomposition map + * @param string $string valid UTF-8 string + * @param array $map hash of expanded decomposition map * @return string a UTF-8 string decomposed, not yet normalized (needs sorting) */ static function fastDecompose( $string, $map ) { @@ -564,7 +564,7 @@ class UtfNormal { * Sorts combining characters into canonical order. This is the * final step in creating decomposed normal forms D and KD. * @private - * @param $string String: a valid, decomposed UTF-8 string. Input is not validated. + * @param string $string a valid, decomposed UTF-8 string. Input is not validated. * @return string a UTF-8 string with combining characters sorted in canonical order */ static function fastCombiningSort( $string ) { @@ -616,7 +616,7 @@ class UtfNormal { * Produces canonically composed sequences, i.e. normal form C or KC. * * @private - * @param $string String: a valid UTF-8 string in sorted normal form D or KD. Input is not validated. + * @param string $string a valid UTF-8 string in sorted normal form D or KD. Input is not validated. * @return string a UTF-8 string with canonical precomposed characters used where possible */ static function fastCompose( $string ) { @@ -627,8 +627,8 @@ class UtfNormal { $lastHangul = 0; $startChar = ''; $combining = ''; - $x1 = ord(substr(UTF8_HANGUL_VBASE,0,1)); - $x2 = ord(substr(UTF8_HANGUL_TEND,0,1)); + $x1 = ord(substr(UTF8_HANGUL_VBASE, 0, 1)); + $x2 = ord(substr(UTF8_HANGUL_TEND, 0, 1)); for( $i = 0; $i < $len; $i++ ) { $c = $string[$i]; $n = ord( $c ); @@ -762,10 +762,10 @@ class UtfNormal { * Function to replace some characters that we don't want * but most of the native normalize functions keep. * - * @param $string String The string + * @param string $string The string * @return String String with the character codes replaced. */ - private static function replaceForNativeNormalize( $string ) { + private static function replaceForNativeNormalize( $string ) { $string = preg_replace( '/[\x00-\x08\x0b\x0c\x0e-\x1f]/', UTF8_REPLACEMENT, -- cgit v1.2.2