diff --git a/plugins/linkit_search/file.class.php b/plugins/linkit_search/file.class.php index 32930e8..22ff7f9 100644 --- a/plugins/linkit_search/file.class.php +++ b/plugins/linkit_search/file.class.php @@ -110,7 +110,7 @@ class LinkitSearchPluginFile extends LinkitSearchPluginEntity { case LINKIT_FILE_URL_TYPE_DIRECT: // Check if this is a local file. $wrapper = file_stream_wrapper_get_instance_by_uri($entity->uri); - if ($wrapper instanceof DrupalLocalStreamWrapper) { + if ($wrapper instanceof DrupalLocalStreamWrapper && strpos($entity->uri, 'private://') === FALSE) { // Create a relative URL to the local file. // See https://www.drupal.org/node/837794. $path = $wrapper->getDirectoryPath() . '/' . file_uri_target($entity->uri);