[SCRIPTS] ~fix nouveau chemin d installation de SPIP
[lhc/web/www.git] / www / plugins-dist / medias / lib / getid3 / module.misc.msoffice.php
1 <?php
2
3 /////////////////////////////////////////////////////////////////
4 /// getID3() by James Heinrich <info@getid3.org> //
5 // available at https://github.com/JamesHeinrich/getID3 //
6 // or https://www.getid3.org //
7 // or http://getid3.sourceforge.net //
8 // see readme.txt for more details //
9 /////////////////////////////////////////////////////////////////
10 // //
11 // module.misc.msoffice.php //
12 // module for analyzing MS Office (.doc, .xls, etc) files //
13 // dependencies: NONE //
14 // ///
15 /////////////////////////////////////////////////////////////////
16
17
18 class getid3_msoffice extends getid3_handler
19 {
20 /**
21 * @return bool
22 */
23 public function Analyze() {
24 $info = &$this->getid3->info;
25
26 $this->fseek($info['avdataoffset']);
27 $DOCFILEheader = $this->fread(8);
28 $magic = "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1";
29 if (substr($DOCFILEheader, 0, 8) != $magic) {
30 $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at '.$info['avdataoffset'].', found '.getid3_lib::PrintHexBytes(substr($DOCFILEheader, 0, 8)).' instead.');
31 return false;
32 }
33 $info['fileformat'] = 'msoffice';
34
35 $this->error('MS Office (.doc, .xls, etc) parsing not enabled in this version of getID3() ['.$this->getid3->version().']');
36 return false;
37
38 }
39
40 }