Version 4.5.0
This commit is contained in:
1 parent
1a0c7fd3c2
commit
f79dcf067a
3791 files changed
+248032
-76372
No files matched your search
@@ -79,7 +79,7 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
|
||||
$charsetTable = $charsetTables[ $from ];
|
||||
|
||||
if( !count($charsetTable) )
|
||||
if( !\count($charsetTable) )
|
||||
{
|
||||
static::$errors[] = "Character set table not found";
|
||||
return $original;
|
||||
@@ -92,7 +92,7 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
{
|
||||
$hexChar = "";
|
||||
$unicodeHexChar = "";
|
||||
$hexChar = strtoupper(dechex(ord($string[$i])));
|
||||
$hexChar = strtoupper(dechex(\ord($string[$i])));
|
||||
|
||||
// This is fix from Mario Klingemann, it prevents
|
||||
// droping chars below 16 because of missing leading 0 [zeros]
|
||||
@@ -106,17 +106,17 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
if ( ( $from == "gsm0338" ) && ( $hexChar == '1B' ) )
|
||||
{
|
||||
$i++;
|
||||
$hexChar .= strtoupper(dechex(ord($string[$i])));
|
||||
$hexChar .= strtoupper(dechex(\ord($string[$i])));
|
||||
}
|
||||
|
||||
if ( $to != "utf-8" )
|
||||
{
|
||||
if ( in_array( $hexChar, $charsetTable[$from] ) )
|
||||
if ( \in_array( $hexChar, $charsetTable[$from] ) )
|
||||
{
|
||||
$unicodeHexChar = array_search( $hexChar, $charsetTable[$from] );
|
||||
$unicodeHexChars = explode( "+",$unicodeHexChar );
|
||||
|
||||
for( $unicodeHexCharElement = 0; $unicodeHexCharElement < count($unicodeHexChars); $unicodeHexCharElement++ )
|
||||
for( $unicodeHexCharElement = 0; $unicodeHexCharElement < \count($unicodeHexChars); $unicodeHexCharElement++ )
|
||||
{
|
||||
if ( array_key_exists( $unicodeHexChars[$unicodeHexCharElement], $charsetTable[$to] ) )
|
||||
{
|
||||
@@ -126,7 +126,7 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
}
|
||||
else
|
||||
{
|
||||
$text .= chr(hexdec($charsetTable[$to][$unicodeHexChars[$unicodeHexCharElement]]));
|
||||
$text .= \chr(hexdec($charsetTable[$to][$unicodeHexChars[$unicodeHexCharElement]]));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -144,7 +144,7 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( in_array( $hexChar, $charsetTable[$from] ) )
|
||||
if ( \in_array( $hexChar, $charsetTable[$from] ) )
|
||||
{
|
||||
$unicodeHexChar = array_search( $hexChar, $charsetTable[$from] );
|
||||
$unicodeHexChars = explode( "+", $unicodeHexChar );
|
||||
@@ -158,7 +158,7 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
* In Mazowia we have 007A+0142, but sometimes it can look like this
|
||||
* 0x007A+0x0142+0x2034 (that string means nothing, it just shows the possibility...)
|
||||
*/
|
||||
for( $unicodeHexCharElement = 0; $unicodeHexCharElement < count($unicodeHexChars); $unicodeHexCharElement++)
|
||||
for( $unicodeHexCharElement = 0; $unicodeHexCharElement < \count($unicodeHexChars); $unicodeHexCharElement++)
|
||||
{
|
||||
if ( self::$entities == true )
|
||||
{
|
||||
@@ -189,7 +189,7 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
$unicodeHexChar = "";
|
||||
$charsetTable = self::_makeConversionTable( $to );
|
||||
|
||||
if( is_array($charsetTable[$to]) AND count($charsetTable[$to]) )
|
||||
if( \is_array($charsetTable[$to]) AND \count($charsetTable[$to]) )
|
||||
{
|
||||
foreach ( $charsetTable[$to] as $unicodeHexChar => $hexChar )
|
||||
{
|
||||
@@ -199,7 +199,7 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
}
|
||||
else
|
||||
{
|
||||
$entityOrChar = chr(hexdec($hexChar));
|
||||
$entityOrChar = \chr(hexdec($hexChar));
|
||||
}
|
||||
|
||||
$string = str_replace( self::_hexToUtf( $unicodeHexChar), $entityOrChar, $string );
|
||||
@@ -227,7 +227,7 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
for( $charPosition = 0; $charPosition < $stringLength; $charPosition++ )
|
||||
{
|
||||
$char = $unicodeString [$charPosition];
|
||||
$asciiChar = ord ($char);
|
||||
$asciiChar = \ord ($char);
|
||||
|
||||
if ($asciiChar < 128) //1 7 0bbbbbbb (127)
|
||||
{
|
||||
@@ -238,7 +238,7 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
$firstByte = ($asciiChar & 31);
|
||||
$charPosition++;
|
||||
$char = $unicodeString [$charPosition];
|
||||
$asciiChar = ord ($char);
|
||||
$asciiChar = \ord ($char);
|
||||
$secondByte = ($asciiChar & 63);
|
||||
$asciiChar = ($firstByte * 64) + $secondByte;
|
||||
|
||||
@@ -250,11 +250,11 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
$firstByte = ($asciiChar & 31);
|
||||
$charPosition++;
|
||||
$char = $unicodeString [$charPosition];
|
||||
$asciiChar = ord ($char);
|
||||
$asciiChar = \ord ($char);
|
||||
$secondByte = ($asciiChar & 63);
|
||||
$charPosition++;
|
||||
$char = $unicodeString [$charPosition];
|
||||
$asciiChar = ord ($char);
|
||||
$asciiChar = \ord ($char);
|
||||
$thirdByte = ($asciiChar & 63);
|
||||
$asciiChar = ((($firstByte * 64) + $secondByte) * 64) + $thirdByte;
|
||||
|
||||
@@ -266,15 +266,15 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
$firstByte = ($asciiChar & 31);
|
||||
$charPosition++;
|
||||
$char = $unicodeString [$charPosition];
|
||||
$asciiChar = ord ($char);
|
||||
$asciiChar = \ord ($char);
|
||||
$secondByte = ($asciiChar & 63);
|
||||
$charPosition++;
|
||||
$char = $unicodeString [$charPosition];
|
||||
$asciiChar = ord ($char);
|
||||
$asciiChar = \ord ($char);
|
||||
$thirdByte = ($asciiChar & 63);
|
||||
$charPosition++;
|
||||
$char = $unicodeString [$charPosition];
|
||||
$asciiChar = ord ($char);
|
||||
$asciiChar = \ord ($char);
|
||||
$fourthByte = ($asciiChar & 63);
|
||||
$asciiChar = ((((($firstByte * 64) + $secondByte) * 64) + $thirdByte) * 64) + $fourthByte;
|
||||
|
||||
@@ -302,19 +302,19 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
|
||||
if( $utfCharInDec < 128 )
|
||||
{
|
||||
$outputChar .= chr($utfCharInDec);
|
||||
$outputChar .= \chr($utfCharInDec);
|
||||
}
|
||||
else if( $utfCharInDec < 2048 )
|
||||
{
|
||||
$outputChar .= chr( ( $utfCharInDec>>6 ) + 192 ) . chr( ( $utfCharInDec&63 ) + 128 );
|
||||
$outputChar .= \chr( ( $utfCharInDec>>6 ) + 192 ) . \chr( ( $utfCharInDec&63 ) + 128 );
|
||||
}
|
||||
else if( $utfCharInDec < 65536 )
|
||||
{
|
||||
$outputChar .= chr( ( $utfCharInDec>>12 ) + 224 ) . chr( ( ( $utfCharInDec>>6 ) &63 ) + 128 ) . chr( ( $utfCharInDec&63 ) + 128 );
|
||||
$outputChar .= \chr( ( $utfCharInDec>>12 ) + 224 ) . \chr( ( ( $utfCharInDec>>6 ) &63 ) + 128 ) . \chr( ( $utfCharInDec&63 ) + 128 );
|
||||
}
|
||||
else if( $utfCharInDec < 2097152 )
|
||||
{
|
||||
$outputChar .= chr( $utfCharInDec>>18+240 ) . chr( ( ( $utfCharInDec>>12 ) &63 ) + 128 ) . chr( ( $utfCharInDec>>6 ) &63 + 128 ) . chr( $utfCharInDec&63 + 128 );
|
||||
$outputChar .= \chr( $utfCharInDec>>18+240 ) . \chr( ( ( $utfCharInDec>>12 ) &63 ) + 128 ) . \chr( ( $utfCharInDec>>6 ) &63 + 128 ) . \chr( $utfCharInDec&63 + 128 );
|
||||
}
|
||||
|
||||
return $outputChar;
|
||||
@@ -360,13 +360,13 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
{
|
||||
$convertTable = array();
|
||||
|
||||
for( $i = 0; $i < func_num_args(); $i++ )
|
||||
for( $i = 0, $j = \func_num_args(); $i < $j; $i++ )
|
||||
{
|
||||
/**
|
||||
* Because func_*** can't be used inside of another function call
|
||||
* we have to save it as a separate value.
|
||||
*/
|
||||
$fileName = func_get_arg($i);
|
||||
$fileName = \func_get_arg($i);
|
||||
|
||||
if ( !is_file( static::$charsetPath . $fileName ) )
|
||||
{
|
||||
@@ -406,7 +406,7 @@ class Internal extends \IPSUtf8\Text\Charset
|
||||
$arrayKey = strtoupper(str_replace(strtolower("0x"), "", $hexValue[1]));
|
||||
$arrayValue = strtoupper(str_replace(strtolower("0x"), "", $hexValue[0]));
|
||||
|
||||
$convertTable[ func_get_arg($i) ][ $arrayKey ] = $arrayValue;
|
||||
$convertTable[ \func_get_arg($i) ][ $arrayKey ] = $arrayValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user