Project

General

Profile

Actions

Bug #44381

closed

indexed_search FE Plugin doesn't show external urls in TYPO3 4.7.7

Added by Alexander Bohndorf almost 12 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Must have
Category:
Indexed Search
Target version:
Start date:
2013-01-08
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
4.7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

The FE plugin of indexed_search doesn't show any external urls which start with http:// or https:// (or any other protocol).
These URLs have been added to the index correctly (via crawler).

The reason for that is in class.tx_indexedsearch.php in line 1247 ff. in function checkExistance($row).

The check is done for any paths with is_file() in line 1250. is_file() returns always 0 if used with urls like "http://google.de/".

To solve this problem you can use this alternative checkExistance() implementation:

    function checkExistance($row) {
        $recordExists = TRUE;    // Always expect that page content exists
        if ($row['item_type']) {        // External media:
      if(preg_match('/^http(s)?:\/\//',$row['data_filename'])){
         $ch = curl_init($row['data_filename']);
         curl_setopt($ch, CURLOPT_NOBODY, true);
         curl_exec($ch);
         $recordExists = (curl_getinfo($ch, CURLINFO_HTTP_CODE)==200);
      }
      else {
              if (!is_file($row['data_filename']) || !file_exists($row['data_filename'])) {
                  $recordExists = FALSE;
              }
      }
        }
        return $recordExists;
    }

But this implementation is very slow because each external url of the search results will be checked with one http request.

I created an extension sms_indexedsearch_fixexternals to fix this bug. In this extension you can enable or disable the checking of http(s) URLs in the extension configuration.


Files

Pagination_issue.jpg (33.9 KB) Pagination_issue.jpg Minu Thomas, 2016-04-13 13:20

Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Bug #25699: indexing of external files may be prevented by php's open_basedir restriction (Bug 18520 in core)Closed2011-04-01

Actions
Related to TYPO3 Core - Bug #50095: Indexing of external files and absRefPrefixClosed2013-07-17

Actions
Has duplicate TYPO3 Core - Bug #70458: EXT:indexed_search fails to checkExistance lokal filesClosed2015-10-07

Actions
Actions

Also available in: Atom PDF