Skip to content

Commit

Permalink
Merge pull request #368 from tyrant88/tyrant88-patch-124
Browse files Browse the repository at this point in the history
Release 6.9.7
  • Loading branch information
tyrant88 authored Mar 2, 2023
2 parents 73ee2e0 + b24c216 commit 87809ee
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Changelog
## Version 6.9.7 (2023-03-02)
- Fixes in indexFile und pdf2txt Klasse

## Version 6.9.6 (2023-03-02)
- Fixes for PHP 8.1
- IndexColumn() indexiert jetzt wirklich nur einen Datensatz, wenn id gesetzt #364 thx @tbaddade
Expand Down
2 changes: 1 addition & 1 deletion lib/pdf2txt.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function convert($_data = false)
return false;
}

if ($this->data === false) {
if ($this->data === false || $this->data == null) {
// [ ERROR ]
// nothing to convert
return false;
Expand Down
13 changes: 7 additions & 6 deletions lib/search_it.php
Original file line number Diff line number Diff line change
Expand Up @@ -892,8 +892,9 @@ public function indexColumn($_table, $_column, $_idcol = false, $_id = false, $_
*/
public function indexFile($_filename, $_doPlaintext = false, $_clang = false, $_fid = false, $_catid = false, $clearCache = false): int
{
// $_filename comes with path but stripped of first slash
// $_filename comes with path but needs to be stripped of first slash
// extract file-extension
$_filename = ltrim($_filename, '/');
$filenameArray = explode('.', $_filename);
$fileext = $filenameArray[count($filenameArray) - 1];

Expand Down Expand Up @@ -939,8 +940,8 @@ public function indexFile($_filename, $_doPlaintext = false, $_clang = false, $_
if (function_exists('exec')) {
$tempFile = tempnam(rex_path::cache() . 'addons/mediapool/', 'search_it');
$encoding = 'UTF-8';
//echo 'pdftotext ' . escapeshellarg(rex_path::base($_filename)) . ' ' . escapeshellarg($tempFile) . ' -enc ' . $encoding;
exec('pdftotext -enc ' . $encoding.' '. escapeshellarg(rex_path::base($_filename)) . ' ' . escapeshellarg($tempFile) , $dummy, $return);
//echo 'pdftotext ' . escapeshellarg(rex_path::frontend($_filename)) . ' ' . escapeshellarg($tempFile) . ' -enc ' . $encoding;
exec('pdftotext -enc ' . $encoding.' '. escapeshellarg(rex_path::frontend($_filename)) . ' ' . escapeshellarg($tempFile) , $dummy, $return);

if ($return > 0) {
if ($return == 1) {
Expand Down Expand Up @@ -968,7 +969,7 @@ public function indexFile($_filename, $_doPlaintext = false, $_clang = false, $_

if (!$xpdf) {
// if xpdf returned an error, try pdf2txt via php
if (false === $pdfContent = @rex_file::get(rex_path::base($_filename))) {
if (false === $pdfContent = @rex_file::get(rex_path::frontend($_filename))) {
$error = SEARCH_IT_FILE_NOEXIST;
} else {
$text = pdf2txt::directConvert($pdfContent);
Expand All @@ -989,7 +990,7 @@ public function indexFile($_filename, $_doPlaintext = false, $_clang = false, $_
case 'htm':
case 'html':
case 'php':
if (false === $text = @rex_file::get(rex_path::base($_filename))) {
if (false === $text = @rex_file::get(rex_path::frontend($_filename))) {
return SEARCH_IT_FILE_NOEXIST;
}

Expand All @@ -998,7 +999,7 @@ public function indexFile($_filename, $_doPlaintext = false, $_clang = false, $_

// other filetype
default:
if (false === $text = @rex_file::get(rex_path::base($_filename))) {
if (false === $text = @rex_file::get(rex_path::frontend($_filename))) {
return SEARCH_IT_FILE_NOEXIST;
}

Expand Down
2 changes: 1 addition & 1 deletion package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package: search_it
version: '6.9.6'
version: '6.9.7'
author: Friends Of REDAXO
supportpage: https://github.com/FriendsOfREDAXO/search_it

Expand Down
2 changes: 1 addition & 1 deletion plugins/autocomplete/package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package: search_it/autocomplete
version: '6.9.6'
version: '6.9.7'
author: Manétage

title: 'translate:search_it_autocomplete_plugin_title'
Expand Down
2 changes: 1 addition & 1 deletion plugins/documentation/package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package: search_it/documentation
version: '6.9.6'
version: '6.9.7'
author: Friends Of REDAXO

title: 'translate:search_it_documentation_title'
Expand Down
2 changes: 1 addition & 1 deletion plugins/plaintext/package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package: search_it/plaintext
version: '6.9.6'
version: '6.9.7'
author: Friends Of REDAXO

title: 'translate:search_it_plaintext_title'
Expand Down
2 changes: 1 addition & 1 deletion plugins/stats/package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package: search_it/stats
version: '6.9.6'
version: '6.9.7'
author: Friends Of REDAXO

title: 'translate:search_it_stats_plugin_title'
Expand Down

0 comments on commit 87809ee

Please sign in to comment.