@@ -88,10 +88,10 @@ function table_var_dump($variable) {
88
88
$ variable = str_replace (chr (0 ), ' ' , $ variable );
89
89
$ varlen = strlen ($ variable );
90
90
for ($ i = 0 ; $ i < $ varlen ; $ i ++) {
91
- if (preg_match ('#[ ' .chr (0x0A ).chr (0x0D ).' -;0-9A-Za-z]# ' , $ variable{ $ i } )) {
92
- $ returnstring .= $ variable{ $ i } ;
91
+ if (preg_match ('#[ ' .chr (0x0A ).chr (0x0D ).' -;0-9A-Za-z]# ' , $ variable[ $ i ] )) {
92
+ $ returnstring .= $ variable[ $ i ] ;
93
93
} else {
94
- $ returnstring .= '&# ' .str_pad (ord ($ variable{ $ i } ), 3 , '0 ' , STR_PAD_LEFT ).'; ' ;
94
+ $ returnstring .= '&# ' .str_pad (ord ($ variable[ $ i ] ), 3 , '0 ' , STR_PAD_LEFT ).'; ' ;
95
95
}
96
96
}
97
97
$ returnstring = nl2br ($ returnstring );
@@ -242,19 +242,19 @@ function NormalizeBinaryPoint($binarypointnumber, $maxbits=52) {
242
242
// http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/binary.html
243
243
if (strpos ($ binarypointnumber , '. ' ) === false ) {
244
244
$ binarypointnumber = '0. ' .$ binarypointnumber ;
245
- } elseif ($ binarypointnumber{ 0 } == '. ' ) {
245
+ } elseif ($ binarypointnumber[ 0 ] == '. ' ) {
246
246
$ binarypointnumber = '0 ' .$ binarypointnumber ;
247
247
}
248
248
$ exponent = 0 ;
249
- while (($ binarypointnumber{ 0 } != '1 ' ) || (substr ($ binarypointnumber , 1 , 1 ) != '. ' )) {
249
+ while (($ binarypointnumber[ 0 ] != '1 ' ) || (substr ($ binarypointnumber , 1 , 1 ) != '. ' )) {
250
250
if (substr ($ binarypointnumber , 1 , 1 ) == '. ' ) {
251
251
$ exponent --;
252
252
$ binarypointnumber = substr ($ binarypointnumber , 2 , 1 ).'. ' .substr ($ binarypointnumber , 3 );
253
253
} else {
254
254
$ pointpos = strpos ($ binarypointnumber , '. ' );
255
255
$ exponent += ($ pointpos - 1 );
256
256
$ binarypointnumber = str_replace ('. ' , '' , $ binarypointnumber );
257
- $ binarypointnumber = $ binarypointnumber{ 0 } .'. ' .substr ($ binarypointnumber , 1 );
257
+ $ binarypointnumber = $ binarypointnumber[ 0 ] .'. ' .substr ($ binarypointnumber , 1 );
258
258
}
259
259
}
260
260
$ binarypointnumber = str_pad (substr ($ binarypointnumber , 0 , $ maxbits + 2 ), $ maxbits + 2 , '0 ' , STR_PAD_RIGHT );
@@ -324,7 +324,7 @@ function BigEndian2Float($byteword) {
324
324
// http://www.scri.fsu.edu/~jac/MAD3401/Backgrnd/ieee.html
325
325
326
326
$ bitword = BigEndian2Bin ($ byteword );
327
- $ signbit = $ bitword{ 0 } ;
327
+ $ signbit = $ bitword[ 0 ] ;
328
328
329
329
switch (strlen ($ byteword ) * 8 ) {
330
330
case 32 :
@@ -397,9 +397,9 @@ function BigEndian2Int($byteword, $synchsafe=false, $signed=false) {
397
397
$ bytewordlen = strlen ($ byteword );
398
398
for ($ i = 0 ; $ i < $ bytewordlen ; $ i ++) {
399
399
if ($ synchsafe ) { // disregard MSB, effectively 7-bit bytes
400
- $ intvalue = $ intvalue | (ord ($ byteword{ $ i } ) & 0x7F ) << (($ bytewordlen - 1 - $ i ) * 7 );
400
+ $ intvalue = $ intvalue | (ord ($ byteword[ $ i ] ) & 0x7F ) << (($ bytewordlen - 1 - $ i ) * 7 );
401
401
} else {
402
- $ intvalue += ord($ byteword{ $ i } ) * pow (256 , ($ bytewordlen - 1 - $ i ));
402
+ $ intvalue += ord ($ byteword[ $ i ] ) * pow (256 , ($ bytewordlen - 1 - $ i ));
403
403
}
404
404
}
405
405
if ($ signed && !$ synchsafe ) {
@@ -435,7 +435,7 @@ function BigEndian2Bin($byteword) {
435
435
$ binvalue = '' ;
436
436
$ bytewordlen = strlen ($ byteword );
437
437
for ($ i = 0 ; $ i < $ bytewordlen ; $ i ++) {
438
- $ binvalue .= str_pad(decbin(ord ($ byteword{ $ i } )), 8 , '0 ' , STR_PAD_LEFT );
438
+ $ binvalue .= str_pad (decbin (ord ($ byteword[ $ i ] )), 8 , '0 ' , STR_PAD_LEFT );
439
439
}
440
440
return $ binvalue ;
441
441
}
@@ -562,7 +562,7 @@ function Unsynchronise($data) {
562
562
$ data = str_replace (chr (0xFF ).chr (0x00 ), chr (0xFF ).chr (0x00 ).chr (0x00 ), $ data );
563
563
$ unsyncheddata = '' ;
564
564
for ($ i = 0 ; $ i < strlen ($ data ); $ i ++) {
565
- $ thischar = $ data{ $ i } ;
565
+ $ thischar = $ data[ $ i ] ;
566
566
$ unsyncheddata .= $ thischar ;
567
567
if ($ thischar == chr (255 )) {
568
568
$ nextchar = ord (substr ($ data , $ i + 1 , 1 ));
@@ -677,8 +677,8 @@ function RoughTranslateUnicodeToASCII($rawdata, $frame_textencoding) {
677
677
$ asciidata = substr ($ asciidata , 0 , strlen ($ asciidata ) - 2 ); // remove terminator, only if present (it should be, but...)
678
678
}
679
679
for ($ i = 0 ; $ i < strlen ($ asciidata ); $ i += 2 ) {
680
- if ((ord ($ asciidata{ $ i } ) <= 0x7F ) || (ord ($ asciidata{ $ i } ) >= 0xA0 )) {
681
- $ tempstring .= $ asciidata{ $ i } ;
680
+ if ((ord ($ asciidata[ $ i ] ) <= 0x7F ) || (ord ($ asciidata[ $ i ] ) >= 0xA0 )) {
681
+ $ tempstring .= $ asciidata[ $ i ] ;
682
682
} else {
683
683
$ tempstring .= '? ' ;
684
684
}
@@ -692,8 +692,8 @@ function RoughTranslateUnicodeToASCII($rawdata, $frame_textencoding) {
692
692
$ asciidata = substr ($ asciidata , 0 , strlen ($ asciidata ) - 2 ); // remove terminator, only if present (it should be, but...)
693
693
}
694
694
for ($ i = 0 ; $ i < strlen ($ asciidata ); $ i += 2 ) {
695
- if ((ord ($ asciidata{ $ i } ) <= 0x7F ) || (ord ($ asciidata{ $ i } ) >= 0xA0 )) {
696
- $ tempstring .= $ asciidata{ $ i } ;
695
+ if ((ord ($ asciidata[ $ i ] ) <= 0x7F ) || (ord ($ asciidata[ $ i ] ) >= 0xA0 )) {
696
+ $ tempstring .= $ asciidata[ $ i ] ;
697
697
} else {
698
698
$ tempstring .= '? ' ;
699
699
}
@@ -711,8 +711,8 @@ function RoughTranslateUnicodeToASCII($rawdata, $frame_textencoding) {
711
711
$ asciidata = substr ($ asciidata , 0 , strlen ($ asciidata ) - 2 ); // remove terminator, only if present (it should be, but...)
712
712
}
713
713
for ($ i = 0 ; ($ i + 1 ) < strlen ($ asciidata ); $ i += 2 ) {
714
- if ((ord ($ asciidata{ ($ i + 1 )} ) <= 0x7F ) || (ord ($ asciidata{ ($ i + 1 )} ) >= 0xA0 )) {
715
- $ tempstring .= $ asciidata{ ($ i + 1 )} ;
714
+ if ((ord ($ asciidata[ ($ i + 1 )] ) <= 0x7F ) || (ord ($ asciidata[ ($ i + 1 )] ) >= 0xA0 )) {
715
+ $ tempstring .= $ asciidata[ ($ i + 1 )] ;
716
716
} else {
717
717
$ tempstring .= '? ' ;
718
718
}
@@ -850,26 +850,26 @@ function GUIDtoBytestring($GUIDstring) {
850
850
851
851
if (!function_exists ('BytestringToGUID ' )) {
852
852
function BytestringToGUID ($ Bytestring ) {
853
- $ GUIDstring = str_pad(dechex (ord ($ Bytestring{ 3 } )), 2 , '0 ' , STR_PAD_LEFT );
854
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 2 } )), 2 , '0 ' , STR_PAD_LEFT );
855
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 1 } )), 2 , '0 ' , STR_PAD_LEFT );
856
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 0 } )), 2 , '0 ' , STR_PAD_LEFT );
853
+ $ GUIDstring = str_pad (dechex (ord ($ Bytestring[ 3 ] )), 2 , '0 ' , STR_PAD_LEFT );
854
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 2 ] )), 2 , '0 ' , STR_PAD_LEFT );
855
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 1 ] )), 2 , '0 ' , STR_PAD_LEFT );
856
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 0 ] )), 2 , '0 ' , STR_PAD_LEFT );
857
857
$ GUIDstring .= '- ' ;
858
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 5 } )), 2 , '0 ' , STR_PAD_LEFT );
859
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 4 } )), 2 , '0 ' , STR_PAD_LEFT );
858
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 5 ] )), 2 , '0 ' , STR_PAD_LEFT );
859
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 4 ] )), 2 , '0 ' , STR_PAD_LEFT );
860
860
$ GUIDstring .= '- ' ;
861
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 7 } )), 2 , '0 ' , STR_PAD_LEFT );
862
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 6 } )), 2 , '0 ' , STR_PAD_LEFT );
861
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 7 ] )), 2 , '0 ' , STR_PAD_LEFT );
862
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 6 ] )), 2 , '0 ' , STR_PAD_LEFT );
863
863
$ GUIDstring .= '- ' ;
864
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 8 } )), 2 , '0 ' , STR_PAD_LEFT );
865
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 9 } )), 2 , '0 ' , STR_PAD_LEFT );
864
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 8 ] )), 2 , '0 ' , STR_PAD_LEFT );
865
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 9 ] )), 2 , '0 ' , STR_PAD_LEFT );
866
866
$ GUIDstring .= '- ' ;
867
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 10 } )), 2 , '0 ' , STR_PAD_LEFT );
868
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 11 } )), 2 , '0 ' , STR_PAD_LEFT );
869
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 12 } )), 2 , '0 ' , STR_PAD_LEFT );
870
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 13 } )), 2 , '0 ' , STR_PAD_LEFT );
871
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 14 } )), 2 , '0 ' , STR_PAD_LEFT );
872
- $ GUIDstring .= str_pad (dechex (ord ($ Bytestring{ 15 } )), 2 , '0 ' , STR_PAD_LEFT );
867
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 10 ] )), 2 , '0 ' , STR_PAD_LEFT );
868
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 11 ] )), 2 , '0 ' , STR_PAD_LEFT );
869
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 12 ] )), 2 , '0 ' , STR_PAD_LEFT );
870
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 13 ] )), 2 , '0 ' , STR_PAD_LEFT );
871
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 14 ] )), 2 , '0 ' , STR_PAD_LEFT );
872
+ $ GUIDstring .= str_pad (dechex (ord ($ Bytestring[ 15 ] )), 2 , '0 ' , STR_PAD_LEFT );
873
873
874
874
return strtoupper ($ GUIDstring );
875
875
}
@@ -940,17 +940,17 @@ function utf8_decode($utf8text) {
940
940
$ utf8length = strlen ($ utf8text );
941
941
$ decodedtext = '' ;
942
942
for ($ i = 0 ; $ i < $ utf8length ; $ i ++) {
943
- if ((ord ($ utf8text{ $ i } ) & 0x80 ) == 0 ) {
944
- $ decodedtext .= $ utf8text{ $ i } ;
945
- } elseif ((ord ($ utf8text{ $ i } ) & 0xF0 ) == 0xF0 ) {
943
+ if ((ord ($ utf8text[ $ i ] ) & 0x80 ) == 0 ) {
944
+ $ decodedtext .= $ utf8text[ $ i ] ;
945
+ } elseif ((ord ($ utf8text[ $ i ] ) & 0xF0 ) == 0xF0 ) {
946
946
$ decodedtext .= '? ' ;
947
947
$ i += 3 ;
948
- } elseif ((ord ($ utf8text{ $ i } ) & 0xE0 ) == 0xE0 ) {
948
+ } elseif ((ord ($ utf8text[ $ i ] ) & 0xE0 ) == 0xE0 ) {
949
949
$ decodedtext .= '? ' ;
950
950
$ i += 2 ;
951
- } elseif ((ord ($ utf8text{ $ i } ) & 0xC0 ) == 0xC0 ) {
951
+ } elseif ((ord ($ utf8text[ $ i ] ) & 0xC0 ) == 0xC0 ) {
952
952
// 2 11 110bbbbb 10bbbbbb
953
- $ decodedchar = Bin2Dec (substr (Dec2Bin (ord ($ utf8text{ $ i } )), 3 , 5 ).substr (Dec2Bin (ord ($ utf8text{ ($ i + 1 )} )), 2 , 6 ));
953
+ $ decodedchar = Bin2Dec (substr (Dec2Bin (ord ($ utf8text[ $ i ] )), 3 , 5 ).substr (Dec2Bin (ord ($ utf8text[ ($ i + 1 )] )), 2 , 6 ));
954
954
if ($ decodedchar <= 255 ) {
955
955
$ decodedtext .= chr ($ decodedchar );
956
956
} else {
@@ -1068,7 +1068,7 @@ function CreateDeepArray($ArrayPath, $Separator, $Value) {
1068
1068
// $foo = array('path'=>array('to'=>'array('my'=>array('file.txt'))));
1069
1069
// or
1070
1070
// $foo['path']['to']['my'] = 'file.txt';
1071
- while ($ ArrayPath{ 0 } == $ Separator ) {
1071
+ while ($ ArrayPath[ 0 ] == $ Separator ) {
1072
1072
$ ArrayPath = substr ($ ArrayPath , 1 );
1073
1073
}
1074
1074
if (($ pos = strpos ($ ArrayPath , $ Separator )) !== false ) {
@@ -1916,7 +1916,7 @@ function decodeMPEGaudioHeader($fd, $offset, &$ThisFileInfo, $recursivesearch=tr
1916
1916
if ($ ThisFileInfo ['mpeg ' ]['audio ' ]['xing_flags ' ]['toc ' ]) {
1917
1917
$ LAMEtocData = substr ($ headerstring , $ VBRidOffset + 16 , 100 );
1918
1918
for ($ i = 0 ; $ i < 100 ; $ i ++) {
1919
- $ ThisFileInfo ['mpeg ' ]['audio ' ]['toc ' ][$ i ] = ord ($ LAMEtocData{ $ i } );
1919
+ $ ThisFileInfo ['mpeg ' ]['audio ' ]['toc ' ][$ i ] = ord ($ LAMEtocData[ $ i ] );
1920
1920
}
1921
1921
}
1922
1922
if ($ ThisFileInfo ['mpeg ' ]['audio ' ]['xing_flags ' ]['vbr_scale ' ]) {
@@ -2297,9 +2297,9 @@ function FreeFormatFrameLength($fd, $offset, &$ThisFileInfo, $deepscan=false) {
2297
2297
2298
2298
$ SyncPattern1 = substr ($ MPEGaudioData , 0 , 4 );
2299
2299
// may be different pattern due to padding
2300
- $ SyncPattern2 = $ SyncPattern1{ 0 } .$ SyncPattern1{ 1 } .chr (ord ($ SyncPattern1{ 2 } ) | 0x02 ).$ SyncPattern1{ 3 } ;
2300
+ $ SyncPattern2 = $ SyncPattern1[ 0 ] .$ SyncPattern1[ 1 ] .chr (ord ($ SyncPattern1[ 2 ] ) | 0x02 ).$ SyncPattern1[ 3 ] ;
2301
2301
if ($ SyncPattern2 === $ SyncPattern1 ) {
2302
- $ SyncPattern2 = $ SyncPattern1{ 0 } .$ SyncPattern1{ 1 } .chr (ord ($ SyncPattern1{ 2 } ) & 0xFD ).$ SyncPattern1{ 3 } ;
2302
+ $ SyncPattern2 = $ SyncPattern1[ 0 ] .$ SyncPattern1[ 1 ] .chr (ord ($ SyncPattern1[ 2 ] ) & 0xFD ).$ SyncPattern1[ 3 ] ;
2303
2303
}
2304
2304
2305
2305
$ framelength = false ;
@@ -2435,7 +2435,7 @@ function getOnlyMPEGaudioInfo($fd, &$ThisFileInfo, $avdataoffset, $BitrateHistog
2435
2435
return false ;
2436
2436
}
2437
2437
2438
- if (($ header{ $ SynchSeekOffset} == CONST_FF ) && ($ header{ ($ SynchSeekOffset + 1 )} > CONST_E0 )) { // synch detected
2438
+ if (($ header[ $ SynchSeekOffset] == CONST_FF ) && ($ header[ ($ SynchSeekOffset + 1 )] > CONST_E0 )) { // synch detected
2439
2439
2440
2440
if (!isset ($ FirstFrameThisfileInfo ) && !isset ($ ThisFileInfo ['mpeg ' ]['audio ' ])) {
2441
2441
$ FirstFrameThisfileInfo = $ ThisFileInfo ;
@@ -2764,18 +2764,18 @@ function MPEGaudioHeaderDecode($Header4Bytes) {
2764
2764
}
2765
2765
2766
2766
$ MPEGrawHeader ['synch ' ] = (BigEndian2Int (substr ($ Header4Bytes , 0 , 2 )) & 0xFFE0 ) >> 4 ;
2767
- $ MPEGrawHeader ['version ' ] = (ord ($ Header4Bytes{ 1 } ) & 0x18 ) >> 3 ; // BB
2768
- $ MPEGrawHeader ['layer ' ] = (ord ($ Header4Bytes{ 1 } ) & 0x06 ) >> 1 ; // CC
2769
- $ MPEGrawHeader ['protection ' ] = (ord ($ Header4Bytes{ 1 } ) & 0x01 ); // D
2770
- $ MPEGrawHeader ['bitrate ' ] = (ord ($ Header4Bytes{ 2 } ) & 0xF0 ) >> 4 ; // EEEE
2771
- $ MPEGrawHeader ['sample_rate ' ] = (ord ($ Header4Bytes{ 2 } ) & 0x0C ) >> 2 ; // FF
2772
- $ MPEGrawHeader ['padding ' ] = (ord ($ Header4Bytes{ 2 } ) & 0x02 ) >> 1 ; // G
2773
- $ MPEGrawHeader ['private ' ] = (ord ($ Header4Bytes{ 2 } ) & 0x01 ); // H
2774
- $ MPEGrawHeader ['channelmode ' ] = (ord ($ Header4Bytes{ 3 } ) & 0xC0 ) >> 6 ; // II
2775
- $ MPEGrawHeader ['modeextension ' ] = (ord ($ Header4Bytes{ 3 } ) & 0x30 ) >> 4 ; // JJ
2776
- $ MPEGrawHeader ['copyright ' ] = (ord ($ Header4Bytes{ 3 } ) & 0x08 ) >> 3 ; // K
2777
- $ MPEGrawHeader ['original ' ] = (ord ($ Header4Bytes{ 3 } ) & 0x04 ) >> 2 ; // L
2778
- $ MPEGrawHeader ['emphasis ' ] = (ord ($ Header4Bytes{ 3 } ) & 0x03 ); // MM
2767
+ $ MPEGrawHeader ['version ' ] = (ord ($ Header4Bytes[ 1 ] ) & 0x18 ) >> 3 ; // BB
2768
+ $ MPEGrawHeader ['layer ' ] = (ord ($ Header4Bytes[ 1 ] ) & 0x06 ) >> 1 ; // CC
2769
+ $ MPEGrawHeader ['protection ' ] = (ord ($ Header4Bytes[ 1 ] ) & 0x01 ); // D
2770
+ $ MPEGrawHeader ['bitrate ' ] = (ord ($ Header4Bytes[ 2 ] ) & 0xF0 ) >> 4 ; // EEEE
2771
+ $ MPEGrawHeader ['sample_rate ' ] = (ord ($ Header4Bytes[ 2 ] ) & 0x0C ) >> 2 ; // FF
2772
+ $ MPEGrawHeader ['padding ' ] = (ord ($ Header4Bytes[ 2 ] ) & 0x02 ) >> 1 ; // G
2773
+ $ MPEGrawHeader ['private ' ] = (ord ($ Header4Bytes[ 2 ] ) & 0x01 ); // H
2774
+ $ MPEGrawHeader ['channelmode ' ] = (ord ($ Header4Bytes[ 3 ] ) & 0xC0 ) >> 6 ; // II
2775
+ $ MPEGrawHeader ['modeextension ' ] = (ord ($ Header4Bytes[ 3 ] ) & 0x30 ) >> 4 ; // JJ
2776
+ $ MPEGrawHeader ['copyright ' ] = (ord ($ Header4Bytes[ 3 ] ) & 0x08 ) >> 3 ; // K
2777
+ $ MPEGrawHeader ['original ' ] = (ord ($ Header4Bytes[ 3 ] ) & 0x04 ) >> 2 ; // L
2778
+ $ MPEGrawHeader ['emphasis ' ] = (ord ($ Header4Bytes[ 3 ] ) & 0x03 ); // MM
2779
2779
2780
2780
return $ MPEGrawHeader ;
2781
2781
}
0 commit comments