Project

General

Profile

Bug #19815 » 10125.diff

Administrator Admin, 2009-01-13 17:32

View differences:

typo3/sysext/indexed_search/class.external_parser.php (working copy)
case 'pdf':
if ($this->app['pdfinfo']) {
// Getting pdf-info:
$cmd = $this->app['pdfinfo'].' "'.$absFile.'"';
$cmd = $this->app['pdfinfo'] . ' ' . escapeshellarg($absFile);
exec($cmd,$res);
$pdfInfo = $this->splitPdfInfo($res);
unset($res);
......
// Get pdf content:
$tempFileName = t3lib_div::tempnam('Typo3_indexer'); // Create temporary name
@unlink ($tempFileName); // Delete if exists, just to be safe.
$cmd = $this->app['pdftotext'].' -f '.$low.' -l '.$high.' -enc UTF-8 -q "'.$absFile.'" '.$tempFileName;
$cmd = $this->app['pdftotext'] . ' -f ' . $low . ' -l ' . $high . ' -enc UTF-8 -q ' . escapeshellarg($absFile) .' '.$tempFileName;
exec($cmd);
if (@is_file($tempFileName)) {
$content = t3lib_div::getUrl($tempFileName);
......
break;
case 'doc':
if ($this->app['catdoc']) {
$cmd = $this->app['catdoc'].' -d utf-8 "'.$absFile.'"';
$cmd = $this->app['catdoc'] . ' -d utf-8 ' . escapeshellarg($absFile);
exec($cmd,$res);
$content = implode(chr(10),$res);
unset($res);
......
case 'pps':
case 'ppt':
if ($this->app['ppthtml']) {
$cmd = $this->app['ppthtml'].' "'.$absFile.'"';
$cmd = $this->app['ppthtml'] . ' ' . escapeshellarg($absFile);
exec($cmd,$res);
$content = implode(chr(10),$res);
unset($res);
......
break;
case 'xls':
if ($this->app['xlhtml']) {
$cmd = $this->app['xlhtml'].' -nc -te "'.$absFile.'"';
$cmd = $this->app['xlhtml'] . ' -nc -te ' . escapeshellarg($absFile);
exec($cmd,$res);
$content = implode(chr(10),$res);
unset($res);
......
case 'odt':
if ($this->app['unzip']) {
// Read content.xml:
$cmd = $this->app['unzip'].' -p "'.$absFile.'" content.xml';
$cmd = $this->app['unzip'] . ' -p ' . escapeshellarg($absFile) . ' content.xml';
exec($cmd,$res);
$content_xml = implode(chr(10),$res);
unset($res);
// Read meta.xml:
$cmd = $this->app['unzip'].' -p "'.$absFile.'" meta.xml';
$cmd = $this->app['unzip'] . ' -p ' . escapeshellarg($absFile) . ' meta.xml';
exec($cmd, $res);
$meta_xml = implode(chr(10),$res);
unset($res);
......
break;
case 'rtf':
if ($this->app['unrtf']) {
$cmd = $this->app['unrtf'].' "'.$absFile.'"';
$cmd = $this->app['unrtf'] . ' ' . escapeshellarg($absFile);
exec($cmd,$res);
$fileContent = implode(chr(10),$res);
unset($res);
......
switch ($ext) {
case 'pdf':
// Getting pdf-info:
$cmd = $this->app['pdfinfo'].' "'.$absFile.'"';
$cmd = $this->app['pdfinfo'] . ' ' . escapeshellarg($absFile);
exec($cmd,$res);
$pdfInfo = $this->splitPdfInfo($res);
unset($res);
typo3/sysext/indexed_search/mod/index.php (working copy)
$grListRec = $this->getGrlistRecord($row["phash"]);
$recList[] = array(
$row["data_page_id"].($row["data_page_type"]?"/".$row["data_page_type"]:""),
t3lib_div::fixed_lgd($row["item_title"],30),
htmlspecialchars(t3lib_div::fixed_lgd_cs($row["item_title"],30)),
t3lib_div::formatSize($row["item_size"]),
$this->getNumberOfWords($row["phash"]),
t3lib_BEfunc::datetime($row["item_mtime"]),
......
$cHash = count(unserialize($row["cHashParams"])) ? $this->formatCHash(unserialize($row["cHashParams"])) : "";
$grListRec = $this->getGrlistRecord($row["phash"]);
$recList[]=array(
t3lib_div::fixed_lgd($row["item_title"],30),
htmlentities(t3lib_div::fixed_lgd_cs($row["item_title"],30)),
t3lib_div::formatSize($row["item_size"]),
$this->getNumberOfWords($row["phash"]),
t3lib_BEfunc::datetime($row["item_mtime"]),
......
$row["pcount"],
$cHash,
$row["phash"],
t3lib_div::fixed_lgd($row["data_filename"],100)
htmlentities(t3lib_div::fixed_lgd_cs($row["data_filename"],100))
);
if ($row["pcount"]>1) {
(1-1/2)