[SPIP] ~maj v3.2.9-->v3.2.11
[lhc/web/www.git] / www / plugins-dist / medias / lib / getid3 / module.misc.iso.php
index 231a32a..efca73a 100644 (file)
@@ -14,6 +14,9 @@
 //                                                            ///
 /////////////////////////////////////////////////////////////////
 
+if (!defined('GETID3_INCLUDEPATH')) { // prevent path-exposing attacks that access modules directly on public webservers
+       exit;
+}
 
 class getid3_iso extends getid3_handler
 {
@@ -29,7 +32,7 @@ class getid3_iso extends getid3_handler
                        $this->fseek(2048 * $i);
                        $ISOheader = $this->fread(2048);
                        if (substr($ISOheader, 1, 5) == 'CD001') {
-                               switch (ord($ISOheader{0})) {
+                               switch (ord($ISOheader[0])) {
                                        case 1:
                                                $info['iso']['primary_volume_descriptor']['offset'] = 2048 * $i;
                                                $this->ParsePrimaryVolumeDescriptor($ISOheader);
@@ -296,9 +299,9 @@ class getid3_iso extends getid3_handler
                $DirectoryRecordData = $this->fread(1);
                $DirectoryRecord = array();
 
-               while (ord($DirectoryRecordData{0}) > 33) {
+               while (ord($DirectoryRecordData[0]) > 33) {
 
-                       $DirectoryRecordData .= $this->fread(ord($DirectoryRecordData{0}) - 1);
+                       $DirectoryRecordData .= $this->fread(ord($DirectoryRecordData[0]) - 1);
 
                        $ThisDirectoryRecord = array();
 
@@ -389,13 +392,13 @@ class getid3_iso extends getid3_handler
                // 6: second of the minute from 0 to 59
                // 7: Offset from Greenwich Mean Time in number of 15 minute intervals from -48 (West) to +52 (East)
 
-               $UNIXyear   = ord($ISOtime{0}) + 1900;
-               $UNIXmonth  = ord($ISOtime{1});
-               $UNIXday    = ord($ISOtime{2});
-               $UNIXhour   = ord($ISOtime{3});
-               $UNIXminute = ord($ISOtime{4});
-               $UNIXsecond = ord($ISOtime{5});
-               $GMToffset  = $this->TwosCompliment2Decimal(ord($ISOtime{5}));
+               $UNIXyear   = ord($ISOtime[0]) + 1900;
+               $UNIXmonth  = ord($ISOtime[1]);
+               $UNIXday    = ord($ISOtime[2]);
+               $UNIXhour   = ord($ISOtime[3]);
+               $UNIXminute = ord($ISOtime[4]);
+               $UNIXsecond = ord($ISOtime[5]);
+               $GMToffset  = $this->TwosCompliment2Decimal(ord($ISOtime[5]));
 
                return gmmktime($UNIXhour, $UNIXminute, $UNIXsecond, $UNIXmonth, $UNIXday, $UNIXyear);
        }