Update formatting for media related classes
[lhc/web/wiklou.git] / includes / normal / UtfNormalUtil.php
index e29d8dc..e8fec93 100644 (file)
@@ -71,14 +71,16 @@ function hexSequenceToUtf8( $sequence ) {
  * Take a UTF-8 string and return a space-separated series of hex
  * numbers representing Unicode code points. For debugging.
  *
- * @param $str String: UTF-8 string.
+ * @param string $str UTF-8 string.
  * @return string
  * @private
  */
 function utf8ToHexSequence( $str ) {
-       return rtrim( preg_replace( '/(.)/uSe',
-                                   'sprintf("%04x ", utf8ToCodepoint("$1"))',
-                                   $str ) );
+       $buf = '';
+       foreach ( preg_split( '//u', $str, -1, PREG_SPLIT_NO_EMPTY ) as $cp ) {
+               $buf .= sprintf( '%04x ', utf8ToCodepoint( $cp ) );
+       }
+       return rtrim( $buf );
 }
 
 /**
@@ -125,7 +127,7 @@ function utf8ToCodepoint( $char ) {
 /**
  * Escape a string for inclusion in a PHP single-quoted string literal.
  *
- * @param $string String: string to be escaped.
+ * @param string $string string to be escaped.
  * @return String: escaped string.
  * @public
  */