ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
module.misc.msoffice.php
Go to the documentation of this file.
1<?php
4// available at http://getid3.sourceforge.net //
5// or http://www.getid3.org //
6// also https://github.com/JamesHeinrich/getID3 //
8// See readme.txt for more details //
10// //
11// module.misc.msoffice.php //
12// module for analyzing MS Office (.doc, .xls, etc) files //
13// dependencies: NONE //
14// ///
16
17
19{
20
21 public function Analyze() {
22 $info = &$this->getid3->info;
23
24 $this->fseek($info['avdataoffset']);
25 $DOCFILEheader = $this->fread(8);
26 $magic = "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1";
27 if (substr($DOCFILEheader, 0, 8) != $magic) {
28 $this->error('Expecting "'.getid3_lib::PrintHexBytes($magic).'" at '.$info['avdataoffset'].', found '.getid3_lib::PrintHexBytes(substr($DOCFILEheader, 0, 8)).' instead.');
29 return false;
30 }
31 $info['fileformat'] = 'msoffice';
32
33$this->error('MS Office (.doc, .xls, etc) parsing not enabled in this version of getID3() ['.$this->getid3->version().']');
34return false;
35
36 }
37
38}
An exception for terminatinating execution or to throw for unit testing.
fseek($bytes, $whence=SEEK_SET)
Definition: getid3.php:1711
fread($bytes)
Definition: getid3.php:1683
error($text)
Definition: getid3.php:1752
static PrintHexBytes($string, $hex=true, $spaces=true, $htmlencoding='UTF-8')
Definition: getid3.lib.php:18
getID3() by James Heinrich info@getid3.org //
$info
Definition: index.php:5